Class: AhoSdk::Schemas::RenderTemplatesResource Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aho_sdk/schemas.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Render_templates resource operations

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ RenderTemplatesResource

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of RenderTemplatesResource.



34
35
36
# File 'lib/aho_sdk/schemas.rb', line 34

def initialize(client)
  @client = client
end

Instance Method Details

#create(schema_id:, body: nil, idempotency_key: nil) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create render template

Returns:

  • (Hash)


52
53
54
# File 'lib/aho_sdk/schemas.rb', line 52

def create(schema_id:, body: nil, idempotency_key: nil)
  @client.post("/v1/schemas/#{schema_id}/render_templates", body: body, idempotency_key: idempotency_key)
end

#delete(schema_id:, id:) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Delete render template

Returns:

  • (Hash)


73
74
75
# File 'lib/aho_sdk/schemas.rb', line 73

def delete(schema_id:, id:)
  @client.delete("/v1/schemas/#{schema_id}/render_templates/#{id}")
end

#get(schema_id:, id:) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Get render template

Returns:

  • (Hash)


59
60
61
# File 'lib/aho_sdk/schemas.rb', line 59

def get(schema_id:, id:)
  @client.get("/v1/schemas/#{schema_id}/render_templates/#{id}")
end

#list(schema_id:) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

List render templates

Returns:

  • (Hash)


41
42
43
44
45
46
47
# File 'lib/aho_sdk/schemas.rb', line 41

def list(schema_id:)
  fetch_page = ->(p) {
    response = @client.get("/v1/schemas/#{schema_id}/render_templates")
    Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
  }
  fetch_page.call(1)
end

#update(schema_id:, id:, body: nil, idempotency_key: nil) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Update render template

Returns:

  • (Hash)


66
67
68
# File 'lib/aho_sdk/schemas.rb', line 66

def update(schema_id:, id:, body: nil, idempotency_key: nil)
  @client.patch("/v1/schemas/#{schema_id}/render_templates/#{id}", body: body, idempotency_key: idempotency_key)
end

#validate(schema_id:, body: nil, idempotency_key: nil) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Validate template

Returns:

  • (Hash)


80
81
82
# File 'lib/aho_sdk/schemas.rb', line 80

def validate(schema_id:, body: nil, idempotency_key: nil)
  @client.post("/v1/schemas/#{schema_id}/render_templates/validate", body: body, idempotency_key: idempotency_key)
end