Class: PlatformSdk::Bynder::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url, access_token, conn: nil) ⇒ Client

Returns a new instance of Client.



8
9
10
11
12
# File 'lib/platform_sdk/bynder/client.rb', line 8

def initialize(base_url, access_token, conn: nil)
  @access_token = access_token
  @base_url = base_url
  @conn = conn || build_connection
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



6
7
8
# File 'lib/platform_sdk/bynder/client.rb', line 6

def access_token
  @access_token
end

#base_urlObject (readonly)

Returns the value of attribute base_url.



6
7
8
# File 'lib/platform_sdk/bynder/client.rb', line 6

def base_url
  @base_url
end

#connObject (readonly)

Returns the value of attribute conn.



6
7
8
# File 'lib/platform_sdk/bynder/client.rb', line 6

def conn
  @conn
end

Instance Method Details

#asset(asset_id) ⇒ Object



20
21
22
23
24
# File 'lib/platform_sdk/bynder/client.rb', line 20

def asset(asset_id)
  resource_path = "/api/v4/media"
  response = get(resource_path, { id: asset_id })
  response.body
end

#assets(query_params = {}) ⇒ Object



14
15
16
17
18
# File 'lib/platform_sdk/bynder/client.rb', line 14

def assets(query_params = {})
  resource_path = "/api/v4/media"
  response = get(resource_path, query_params)
  response.body
end