Class: Spaceship::ConnectAPI::Provisioning::Client
- Inherits:
-
Client
show all
- Defined in:
- spaceship/lib/spaceship/connect_api/provisioning/client.rb
Constant Summary
Spaceship::Client::AUTH_TYPES, Spaceship::Client::AccessForbiddenError, Spaceship::Client::AppleTimeoutError, Spaceship::Client::BadGatewayError, Spaceship::Client::BasicPreferredInfoError, Spaceship::Client::GatewayTimeoutError, Spaceship::Client::InsufficientPermissions, Spaceship::Client::InternalServerError, Spaceship::Client::InvalidUserCredentialsError, Spaceship::Client::NoUserCredentialsError, Spaceship::Client::PROTOCOL_VERSION, Spaceship::Client::ProgramLicenseAgreementUpdated, Spaceship::Client::USER_AGENT, Spaceship::Client::UnauthorizedAccessError, Spaceship::Client::UnexpectedResponse
Instance Attribute Summary
Attributes inherited from Client
#token
#client, #csrf_tokens, #logger, #provider, #user, #user_email
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Client
#build_params, #initialize, #patch, #web_session?
#UI, #ask_for_2fa_code, #choose_phone_number, client_with_authorization_from, #cookie, #detect_most_common_errors_and_raise_exceptions, #fastlane_user_dir, #fetch_olympus_session, #fetch_program_license_agreement_messages, #handle_two_factor, #handle_two_step, #handle_two_step_for_device, #handle_two_step_or_factor, #initialize, #itc_service_key, #load_session_from_env, #load_session_from_file, login, #login, #page_size, #paging, #parse_response, #persistent_cookie_path, #phone_id_from_masked_number, #phone_id_from_number, #raise_insufficient_permission_error!, #request, #request_two_factor_code_from_phone, #request_two_factor_code_from_phone_choose, #send_shared_login_request, #sms_automatically_sent, #sms_fallback, spaceship_session_env, #store_cookie, #store_session, #team_id, #team_id=, #team_information, #team_name, #teams, #update_request_headers, #user_details_data, #with_retry
Class Method Details
.hostname ⇒ Object
27
28
29
|
# File 'spaceship/lib/spaceship/connect_api/provisioning/client.rb', line 27
def self.hostname
'https://developer.apple.com/services-account/v1/'
end
|
Instance Method Details
#delete(url_or_path, params = nil) ⇒ Object
51
52
53
54
55
56
57
|
# File 'spaceship/lib/spaceship/connect_api/provisioning/client.rb', line 51
def delete(url_or_path, params = nil)
return proxy_delete(url_or_path, params) if web_session?
super(url_or_path, params)
end
|
#get(url_or_path, params = nil) ⇒ Object
35
36
37
38
39
40
41
|
# File 'spaceship/lib/spaceship/connect_api/provisioning/client.rb', line 35
def get(url_or_path, params = nil)
return proxy_get(url_or_path, params) if web_session?
super(url_or_path, params)
end
|
#post(url_or_path, body) ⇒ Object
43
44
45
46
47
48
49
|
# File 'spaceship/lib/spaceship/connect_api/provisioning/client.rb', line 43
def post(url_or_path, body)
return proxy_post(url_or_path, body) if web_session?
super(url_or_path, body)
end
|
#proxy_delete(url_or_path, params = nil) ⇒ Object
85
86
87
88
89
90
91
92
93
94
95
96
97
|
# File 'spaceship/lib/spaceship/connect_api/provisioning/client.rb', line 85
def proxy_delete(url_or_path, params = nil)
encoded_params = Faraday::NestedParamsEncoder.encode(params)
body = { "urlEncodedQueryParams" => encoded_params, "teamId" => team_id }
response = request(:post) do |req|
req.url(url_or_path)
req.body = body.to_json
req.['Content-Type'] = 'application/vnd.api+json'
req.['X-HTTP-Method-Override'] = 'DELETE'
req.['X-Requested-With'] = 'XMLHttpRequest'
end
handle_response(response)
end
|
#proxy_get(url_or_path, params = nil) ⇒ Object
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'spaceship/lib/spaceship/connect_api/provisioning/client.rb', line 59
def proxy_get(url_or_path, params = nil)
encoded_params = Faraday::NestedParamsEncoder.encode(params)
body = { "urlEncodedQueryParams" => encoded_params, "teamId" => team_id }
response = request(:post) do |req|
req.url(url_or_path)
req.body = body.to_json
req.['Content-Type'] = 'application/vnd.api+json'
req.['X-HTTP-Method-Override'] = 'GET'
req.['X-Requested-With'] = 'XMLHttpRequest'
end
handle_response(response)
end
|
#proxy_post(url_or_path, body) ⇒ Object
73
74
75
76
77
78
79
80
81
82
83
|
# File 'spaceship/lib/spaceship/connect_api/provisioning/client.rb', line 73
def proxy_post(url_or_path, body)
body[:data][:attributes][:teamId] = team_id
response = request(:post) do |req|
req.url(url_or_path)
req.body = body.to_json
req.['Content-Type'] = 'application/vnd.api+json'
req.['X-Requested-With'] = 'XMLHttpRequest'
end
handle_response(response)
end
|