Class: BombBomb::AccountsApi
- Inherits:
-
Object
- Object
- BombBomb::AccountsApi
- Defined in:
- lib/bombbomb/api/accounts_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#account_details(opts = {}) ⇒ nil
Get account details.
-
#account_details_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Get account details.
-
#create_account(team_id, first_name, last_name, email_address, company_name, phone, opts = {}) ⇒ String
Create Account Creates a new BombBomb account.
-
#create_account_with_http_info(team_id, first_name, last_name, email_address, company_name, phone, opts = {}) ⇒ Array<(String, Fixnum, Hash)>
Create Account Creates a new BombBomb account.
-
#initialize(api_client = ApiClient.default) ⇒ AccountsApi
constructor
A new instance of AccountsApi.
-
#subscription_purchase_allowed(opts = {}) ⇒ nil
Check if subscription purchase allowed.
-
#subscription_purchase_allowed_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Check if subscription purchase allowed.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ AccountsApi
Returns a new instance of AccountsApi.
30 31 32 |
# File 'lib/bombbomb/api/accounts_api.rb', line 30 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
28 29 30 |
# File 'lib/bombbomb/api/accounts_api.rb', line 28 def api_client @api_client end |
Instance Method Details
#account_details(opts = {}) ⇒ nil
Get account details. Get the details of the user’s account.
41 42 43 44 |
# File 'lib/bombbomb/api/accounts_api.rb', line 41 def account_details(opts = {}) account_details_with_http_info(opts) return nil end |
#account_details_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Get account details. Get the details of the user's account.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/bombbomb/api/accounts_api.rb', line 53 def account_details_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AccountsApi.account_details ..." end # resource path local_var_path = "/accounts".sub('{format}','json') # query parameters query_params = {} query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil? query_params[:'pw'] = opts[:'pw'] if !opts[:'pw'].nil? query_params[:'api_key'] = opts[:'api_key'] if !opts[:'api_key'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/x-www-form-urlencoded'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#account_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_account(team_id, first_name, last_name, email_address, company_name, phone, opts = {}) ⇒ String
Create Account Creates a new BombBomb account. This method is currently only available to paid seat admins.
110 111 112 113 |
# File 'lib/bombbomb/api/accounts_api.rb', line 110 def create_account(team_id, first_name, last_name, email_address, company_name, phone, opts = {}) data, _status_code, _headers = create_account_with_http_info(team_id, first_name, last_name, email_address, company_name, phone, opts) return data end |
#create_account_with_http_info(team_id, first_name, last_name, email_address, company_name, phone, opts = {}) ⇒ Array<(String, Fixnum, Hash)>
Create Account Creates a new BombBomb account. This method is currently only available to paid seat admins.
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/bombbomb/api/accounts_api.rb', line 130 def create_account_with_http_info(team_id, first_name, last_name, email_address, company_name, phone, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AccountsApi.create_account ..." end # verify the required parameter 'team_id' is set fail ArgumentError, "Missing the required parameter 'team_id' when calling AccountsApi.create_account" if team_id.nil? # verify the required parameter 'first_name' is set fail ArgumentError, "Missing the required parameter 'first_name' when calling AccountsApi.create_account" if first_name.nil? # verify the required parameter 'last_name' is set fail ArgumentError, "Missing the required parameter 'last_name' when calling AccountsApi.create_account" if last_name.nil? # verify the required parameter 'email_address' is set fail ArgumentError, "Missing the required parameter 'email_address' when calling AccountsApi.create_account" if email_address.nil? # verify the required parameter 'company_name' is set fail ArgumentError, "Missing the required parameter 'company_name' when calling AccountsApi.create_account" if company_name.nil? # verify the required parameter 'phone' is set fail ArgumentError, "Missing the required parameter 'phone' when calling AccountsApi.create_account" if phone.nil? # resource path local_var_path = "/accounts".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/x-www-form-urlencoded'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} form_params["teamId"] = team_id form_params["firstName"] = first_name form_params["lastName"] = last_name form_params["emailAddress"] = email_address form_params["companyName"] = company_name form_params["phone"] = phone form_params["country"] = opts[:'country'] if !opts[:'country'].nil? form_params["industry"] = opts[:'industry'] if !opts[:'industry'].nil? form_params["address"] = opts[:'address'] if !opts[:'address'].nil? form_params["city"] = opts[:'city'] if !opts[:'city'].nil? form_params["postalCode"] = opts[:'postal_code'] if !opts[:'postal_code'].nil? # http body (model) post_body = nil auth_names = ['BBOAuth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#create_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#subscription_purchase_allowed(opts = {}) ⇒ nil
Check if subscription purchase allowed. Check whether the user can purchase a subscription.
200 201 202 203 |
# File 'lib/bombbomb/api/accounts_api.rb', line 200 def subscription_purchase_allowed(opts = {}) subscription_purchase_allowed_with_http_info(opts) return nil end |
#subscription_purchase_allowed_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Check if subscription purchase allowed. Check whether the user can purchase a subscription.
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/bombbomb/api/accounts_api.rb', line 212 def subscription_purchase_allowed_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AccountsApi.subscription_purchase_allowed ..." end # resource path local_var_path = "/accounts/purchaseable".sub('{format}','json') # query parameters query_params = {} query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil? query_params[:'pw'] = opts[:'pw'] if !opts[:'pw'].nil? query_params[:'api_key'] = opts[:'api_key'] if !opts[:'api_key'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/x-www-form-urlencoded'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#subscription_purchase_allowed\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |