Class: VoucherifySdk::MetadataSchemasApi

Inherits:
Object
  • Object
show all
Defined in:
lib/VoucherifySdk/api/metadata_schemas_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MetadataSchemasApi

Returns a new instance of MetadataSchemasApi.



19
20
21
# File 'lib/VoucherifySdk/api/metadata_schemas_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/VoucherifySdk/api/metadata_schemas_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_metadata_schema(resource, opts = {}) ⇒ MetadataSchemasGetResponseBody

Get Metadata Schema Retrieves a metadata schema per resource type. # Resource types ## Standard You can retrieve metadata schemas for the standard metadata schema definitions listed below. Add one of these types as the resource path parameter. - campaign - customer - earning_rule - loyalty_tier - order - order_item - product - promotion_tier - publication - redemption - reward - voucher ## Custom If you have defined a [custom metadata schema](support.voucherify.io/article/99-schema-validation-metadata#add-metadata), provide its name in the resource field to retrieve its details. 📘 Management API If you have Management API enabled, you can also use the Get Metadata Schemas endpoint to retrieve a metadata schema using its ID.

Parameters:

  • resource (String)

    There is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/VoucherifySdk/api/metadata_schemas_api.rb', line 27

def (resource, opts = {})
  data, _status_code, _headers = (resource, opts)
  data
end

#list_metadata_schemas(opts = {}) ⇒ MetadataSchemasListResponseBody

List Metadata Schemas Retrieve metadata schema definitions. 📘 Management API If you have Management API enabled, you can also use the List Metadata Schemas endpoint to list all metadata schemas.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



85
86
87
88
# File 'lib/VoucherifySdk/api/metadata_schemas_api.rb', line 85

def (opts = {})
  data, _status_code, _headers = (opts)
  data
end