module StrawberryAPI::Client::CustomMetadataFields

Public Instance Methods

custom_metadata_field(id:) click to toggle source

Fetches a ustom metadata field

@param [Integer] id Id of the ustom metadata field to retrieve

@return [StrawberryAPI::Feature] The fetched ustom metadata field

# File lib/strawberry_api/client/custom_metadata_fields.rb, line 22
def custom_metadata_field(id:)
   data = get("/custom_metadata_fields/#{id}").parse['custommetadatafield']
   data.nil? ? nil : CustomMetadataField.new(data)
end
custom_metadata_fields() click to toggle source

Fetches all custom metadata fields

@return [Array<StrawberryAPI::CustomMetadataField>] A list of custom metadata fields

# File lib/strawberry_api/client/custom_metadata_fields.rb, line 10
def custom_metadata_fields
  get("/custom_metadata_fields").parse['array']&.map do |field|
    CustomMetadataField.new(field)
  end
end
update_custom_metadata_field(id:, options: {}) click to toggle source

Updates a custom metadata field

@param [Interger] id Id of the custom metadata field to update @param [Hash] options Hash of options

@return [StrawberryAPI::CustomMetadataField] The updated custom metadata field

# File lib/strawberry_api/client/custom_metadata_fields.rb, line 34
def update_custom_metadata_field(id:, options: {})
  data = put("/custom_metadata_fields/#{id}", body: options.to_json).parse['custommetadatafield']
  data.nil? ? nil : CustomMetadataField.new(data)
end