Class: Mediaflux::ProjectApproveRequest

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

Overview

Constructs a request to mediaflux to approve a project

Examples:

project = Project.first
project.save_in_mediaflux(session_id: SystemUser.mediaflux_session)
approve_req = Mediaflux::ProjectApproveRequest.new(session_token: SystemUser.mediaflux_session, project:)
approve_req.resolve

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:, project:, xml_namespace: nil, xml_namespace_uri: nil) ⇒ ProjectApproveRequest

Constructor

Parameters:

  • session_token (String)

    the API token for the authenticated session

  • project (Project)

    project to approve

  • xml_namespace (String) (defaults to: nil)

    XML namespace for the <project> element



17
18
19
20
21
22
23
# File 'app/models/mediaflux/project_approve_request.rb', line 17

def initialize(session_token:, project:, xml_namespace: nil, xml_namespace_uri: nil)
  super(session_token: session_token)
  @project = project
  @project_metadata = project.
  @xml_namespace = xml_namespace || self.class.default_xml_namespace
  @xml_namespace_uri = xml_namespace_uri || self.class.default_xml_namespace_uri
end

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project.



12
13
14
# File 'app/models/mediaflux/project_approve_request.rb', line 12

def project
  @project
end

#project_metadataObject (readonly)

Returns the value of attribute project_metadata.



12
13
14
# File 'app/models/mediaflux/project_approve_request.rb', line 12

def 
  @project_metadata
end

Class Method Details

.serviceString

Specifies the Mediaflux service to use when updating assets

Returns:

  • (String)


27
28
29
# File 'app/models/mediaflux/project_approve_request.rb', line 27

def self.service
  "asset.set"
end