Class: AppStoreDevApi::Client::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/app_store_dev_api/client/builder.rb

Instance Method Summary collapse

Instance Method Details

#sourceObject



78
79
80
81
82
83
84
85
86
87
88
# File 'lib/app_store_dev_api/client/builder.rb', line 78

def source
  @source ||= begin
    require 'erb'

    erb = ERB.new(TEMPLATE, trim_mode: '%-')

    erb.result(binding)
  end

  @source
end

#web_service_endpointsObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/app_store_dev_api/client/builder.rb', line 35

def web_service_endpoints
  [
    {
      "alias": 'create_certificate',
      "http_method": 'post',
      "url": 'https://api.appstoreconnect.apple.com/v1/certificates',
      "http_body_type": 'Requests::V1::Certificate::Create',
      "see": 'https://developer.apple.com/documentation/appstoreconnectapi'
    },
    {
      "http_method": 'delete',
      "url": 'https://api.appstoreconnect.apple.com/v1/users/{id}/relationships/visibleApps',
      "alias": 'delete_visible_app',
      "see": 'https://developer.apple.com/documentation/appstoreconnectapi'
    },
    {
      "alias": 'create_bundle_id',
      "url": 'https://api.appstoreconnect.apple.com/v1/bundleIds',
      "http_body_type": 'Requests::V1::BundleId::Create',
      "http_method": 'post',
      "see": 'https://developer.apple.com/documentation/appstoreconnectapi/register_a_new_bundle_id'
    },
    {
      "alias": 'create_bundle_id_capability',
      "url": 'https://api.appstoreconnect.apple.com/v1/bundleIdCapabilities',
      "http_body_type": 'Requests::V1::BundleIdCapability::Create',
      "http_method": 'post',
      "see": 'https://developer.apple.com/documentation/appstoreconnectapi'
    },
    {
      "alias": 'create_beta_build_localization',
      "url": 'https://api.appstoreconnect.apple.com/v1/betaBuildLocalizations',
      "http_body_type": 'Requests::V1::BetaBuildLocalization::Create',
      "http_method": 'post',
      "see": 'https://developer.apple.com/documentation/appstoreconnectapi'
    }
  ].map(&:symbolize_keys)
end

#writeObject



74
75
76
# File 'lib/app_store_dev_api/client/builder.rb', line 74

def write
  File.write('lib/app_store_dev_api/client.rb', source)
end