Module: StrawberryAPI::Client::CustomMetadataFields
- Included in:
- StrawberryAPI::Client
- Defined in:
- lib/strawberry_api/client/custom_metadata_fields.rb
Instance Method Summary collapse
-
#custom_metadata_field(id:) ⇒ StrawberryAPI::Feature
Fetches a ustom metadata field.
-
#custom_metadata_fields ⇒ Array<StrawberryAPI::CustomMetadataField>
Fetches all custom metadata fields.
-
#update_custom_metadata_field(id:, options: {}) ⇒ StrawberryAPI::CustomMetadataField
Updates a custom metadata field.
Instance Method Details
#custom_metadata_field(id:) ⇒ StrawberryAPI::Feature
Fetches a ustom metadata field
22 23 24 25 |
# File 'lib/strawberry_api/client/custom_metadata_fields.rb', line 22 def (id:) data = get("/custom_metadata_fields/#{id}").parse['custommetadatafield'] data.nil? ? nil : CustomMetadataField.new(data) end |
#custom_metadata_fields ⇒ Array<StrawberryAPI::CustomMetadataField>
Fetches all custom metadata fields
10 11 12 13 14 |
# File 'lib/strawberry_api/client/custom_metadata_fields.rb', line 10 def get("/custom_metadata_fields").parse['array']&.map do |field| CustomMetadataField.new(field) end end |
#update_custom_metadata_field(id:, options: {}) ⇒ StrawberryAPI::CustomMetadataField
Updates a custom metadata field
34 35 36 37 |
# File 'lib/strawberry_api/client/custom_metadata_fields.rb', line 34 def (id:, options: {}) data = put("/custom_metadata_fields/#{id}", body: .to_json).parse['custommetadatafield'] data.nil? ? nil : CustomMetadataField.new(data) end |