Class: NewStoreApi::SupportUsersController

Inherits:
BaseController show all
Defined in:
lib/new_store_api/controllers/support_users_controller.rb

Overview

SupportUsersController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent

Constructor Details

This class inherits a constructor from NewStoreApi::BaseController

Instance Method Details

#create_support_user(body) ⇒ User

🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.
Creates a new support user account. description here

Parameters:

Returns:

  • (User)

    Response from the API call.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/new_store_api/controllers/support_users_controller.rb', line 22

def create_support_user(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/iam/support-users',
                                 Server::API)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(User.method(:from_hash)))
    .execute
end

#destroy_support_user(id) ⇒ void

This method returns an undefined value.

🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.
Deletes the support user account with the specified ID.

Parameters:

  • id (String)

    Required parameter: support user id



50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/new_store_api/controllers/support_users_controller.rb', line 50

def destroy_support_user(id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/iam/support-users/{id}',
                                 Server::API)
               .template_param(new_parameter(id, key: 'id')
                                .should_encode(true))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .is_response_void(true))
    .execute
end