Class: AdobeDocApi::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/adobe_doc_api/client.rb

Constant Summary collapse

OAUTH_URL =
"https://ims-na1.adobelogin.com/ims/token/v3".freeze
API_ENDPOINT_URL =
"https://pdf-services-ue1.adobe.io/operation/documentgeneration"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_id: nil, client_secret: nil, scopes: nil) ⇒ Client

Returns a new instance of Client.



10
11
12
13
14
15
16
17
18
# File 'lib/adobe_doc_api/client.rb', line 10

def initialize(client_id: nil, client_secret: nil, scopes: nil)
  @client_id = client_id || AdobeDocApi.configuration.client_id
  @client_secret = client_secret || AdobeDocApi.configuration.client_secret
  @scopes = scopes || AdobeDocApi.configuration.scopes
  @location_url = nil
  @output_file_path = nil
  @raw_response = nil
  @access_token = get_access_token
end

Instance Attribute Details

#client_idObject (readonly)

Returns the value of attribute client_id.



8
9
10
# File 'lib/adobe_doc_api/client.rb', line 8

def client_id
  @client_id
end

#client_secretObject (readonly)

Returns the value of attribute client_secret.



8
9
10
# File 'lib/adobe_doc_api/client.rb', line 8

def client_secret
  @client_secret
end

#location_urlObject (readonly)

Returns the value of attribute location_url.



8
9
10
# File 'lib/adobe_doc_api/client.rb', line 8

def location_url
  @location_url
end

#raw_responseObject (readonly)

Returns the value of attribute raw_response.



8
9
10
# File 'lib/adobe_doc_api/client.rb', line 8

def raw_response
  @raw_response
end

#scopesObject (readonly)

Returns the value of attribute scopes.



8
9
10
# File 'lib/adobe_doc_api/client.rb', line 8

def scopes
  @scopes
end

Instance Method Details

#submit(json:, template:, output:) ⇒ Object



20
21
22
23
24
25
# File 'lib/adobe_doc_api/client.rb', line 20

def submit(json:, template:, output:)
  @output = output
  @asset_id, upload_uri = upload_presigned_uri
  upload_asset(upload_uri, template: template)
  document_generation(json: json)
end