Class: Mediaflux::ServiceExecuteRequest

Inherits:
Request
  • Object
show all
Defined in:
app/models/mediaflux/service_execute_request.rb

Instance Attribute Summary collapse

Attributes inherited from Request

#session_token

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Request

build_post_request, default_xml_namespace, default_xml_namespace_uri, #error?, find_or_create_http_client, format_date_for_mediaflux, request_path, #resolve, #resolved?, #response_body, #response_error, #response_xml, uri, #xml_payload, #xtoshell_xml

Constructor Details

#initialize(session_token:, service_name:, token: nil, document: nil) ⇒ ServiceExecuteRequest

Constructor

Parameters:

  • session_token (String)

    the API token for the authenticated session

  • service_name (String)

    Name of the service to run. Can be any command like asset.namespace.list

  • token (String) (defaults to: nil)

    Optional User token for the person executing the command

  • document (String) (defaults to: nil)

    Optional xml document to pass on to the service. Used to pass parameters to the command



13
14
15
16
17
18
# File 'app/models/mediaflux/service_execute_request.rb', line 13

def initialize(session_token:, service_name:, token: nil, document: nil)
  super(session_token: session_token)
  @service_name = service_name
  @token = token
  @document = document
end

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document.



4
5
6
# File 'app/models/mediaflux/service_execute_request.rb', line 4

def document
  @document
end

#service_nameObject (readonly)

Returns the value of attribute service_name.



4
5
6
# File 'app/models/mediaflux/service_execute_request.rb', line 4

def service_name
  @service_name
end

#tokenObject (readonly)

Returns the value of attribute token.



4
5
6
# File 'app/models/mediaflux/service_execute_request.rb', line 4

def token
  @token
end

Class Method Details

.serviceString

Specifies the Mediaflux service to use when creating assets

Returns:

  • (String)


22
23
24
# File 'app/models/mediaflux/service_execute_request.rb', line 22

def self.service
  "service.execute"
end