Skip to content

Commit

Permalink
Regenerate client for 5.3.0
Browse files Browse the repository at this point in the history
* Add support for `public_key` endpoints
* Add support for `list_roles` endpoint, and use the new role ids on organization member responses
* Add support for `delete_webhook`, that was missing from the spec
* Add support for copying `custom_roles` when creating a new organization
  • Loading branch information
lucasmazza committed Aug 5, 2024
1 parent c2be86f commit 81ea4d7
Show file tree
Hide file tree
Showing 25 changed files with 3,140 additions and 198 deletions.
11 changes: 11 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ lib/tremendous/models/create_organization200_response.rb
lib/tremendous/models/create_organization200_response_organization.rb
lib/tremendous/models/create_organization_request.rb
lib/tremendous/models/create_organization_request_copy_settings.rb
lib/tremendous/models/create_public_key.rb
lib/tremendous/models/create_public_key200_response.rb
lib/tremendous/models/create_public_key_request.rb
lib/tremendous/models/create_webhook200_response.rb
lib/tremendous/models/create_webhook_request.rb
lib/tremendous/models/currency_codes.rb
Expand Down Expand Up @@ -90,6 +93,8 @@ lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb
lib/tremendous/models/list_rewards401_response.rb
lib/tremendous/models/list_rewards401_response_errors.rb
lib/tremendous/models/list_rewards429_response.rb
lib/tremendous/models/list_roles200_response.rb
lib/tremendous/models/list_roles200_response_roles_inner.rb
lib/tremendous/models/list_webhook_events200_response.rb
lib/tremendous/models/list_webhooks200_response.rb
lib/tremendous/models/list_webhooks200_response_webhooks_inner.rb
Expand All @@ -111,6 +116,9 @@ lib/tremendous/models/organization.rb
lib/tremendous/models/payment_details.rb
lib/tremendous/models/payment_details_refund.rb
lib/tremendous/models/product.rb
lib/tremendous/models/public_key.rb
lib/tremendous/models/public_keys_response.rb
lib/tremendous/models/public_keys_response_public_keys_inner.rb
lib/tremendous/models/recipient.rb
lib/tremendous/models/refund_details.rb
lib/tremendous/models/resend_reward422_response.rb
Expand All @@ -125,7 +133,10 @@ lib/tremendous/models/reward_with_link.rb
lib/tremendous/models/reward_with_link_delivery.rb
lib/tremendous/models/reward_without_link.rb
lib/tremendous/models/reward_without_link_delivery.rb
lib/tremendous/models/role.rb
lib/tremendous/models/simulate_webhook_request.rb
lib/tremendous/models/test_public_key.rb
lib/tremendous/models/test_public_key_request.rb
lib/tremendous/models/update_campaign.rb
lib/tremendous/models/update_campaign_request.rb
lib/tremendous/models/webhook.rb
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
tremendous_ruby (5.2.0)
tremendous_ruby (5.3.0)
faraday (>= 1.0.1, < 3.0)
faraday-multipart

Expand Down
11 changes: 11 additions & 0 deletions lib/tremendous.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
require 'tremendous/models/create_organization200_response_organization'
require 'tremendous/models/create_organization_request'
require 'tremendous/models/create_organization_request_copy_settings'
require 'tremendous/models/create_public_key'
require 'tremendous/models/create_public_key200_response'
require 'tremendous/models/create_public_key_request'
require 'tremendous/models/create_webhook200_response'
require 'tremendous/models/create_webhook_request'
require 'tremendous/models/currency_codes'
Expand Down Expand Up @@ -104,6 +107,8 @@
require 'tremendous/models/list_rewards401_response'
require 'tremendous/models/list_rewards401_response_errors'
require 'tremendous/models/list_rewards429_response'
require 'tremendous/models/list_roles200_response'
require 'tremendous/models/list_roles200_response_roles_inner'
require 'tremendous/models/list_webhook_events200_response'
require 'tremendous/models/list_webhooks200_response'
require 'tremendous/models/list_webhooks200_response_webhooks_inner'
Expand All @@ -125,6 +130,9 @@
require 'tremendous/models/payment_details'
require 'tremendous/models/payment_details_refund'
require 'tremendous/models/product'
require 'tremendous/models/public_key'
require 'tremendous/models/public_keys_response'
require 'tremendous/models/public_keys_response_public_keys_inner'
require 'tremendous/models/recipient'
require 'tremendous/models/refund_details'
require 'tremendous/models/resend_reward422_response'
Expand All @@ -139,7 +147,10 @@
require 'tremendous/models/reward_with_link_delivery'
require 'tremendous/models/reward_without_link'
require 'tremendous/models/reward_without_link_delivery'
require 'tremendous/models/role'
require 'tremendous/models/simulate_webhook_request'
require 'tremendous/models/test_public_key'
require 'tremendous/models/test_public_key_request'
require 'tremendous/models/update_campaign'
require 'tremendous/models/update_campaign_request'
require 'tremendous/models/webhook'
Expand Down
473 changes: 469 additions & 4 deletions lib/tremendous/api/tremendous_api.rb

Large diffs are not rendered by default.

36 changes: 1 addition & 35 deletions lib/tremendous/models/create_member.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,9 @@ class CreateMember
# Email address of the member
attr_accessor :email

# Role of the member within the organization. <table> <thead> <tr> <th>Role</th> <th>Description</th> </tr> </thead> <tr> <td><code>MEMBER</code></td> <td>Limited permissions. Can view their own reward and order histories only.</td> </tr> <tr> <td><code>ADMIN</code></td> <td>Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.</td> </tr> <tbody> </table>
# The role ID of the member within the organization.
attr_accessor :role

class EnumAttributeValidator
attr_reader :datatype
attr_reader :allowable_values

def initialize(datatype, allowable_values)
@allowable_values = allowable_values.map do |value|
case datatype.to_s
when /Integer/i
value.to_i
when /Float/i
value.to_f
else
value
end
end
end

def valid?(value)
!value || allowable_values.include?(value)
end
end

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
Expand Down Expand Up @@ -120,21 +98,9 @@ def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
return false if @email.nil?
return false if @role.nil?
role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"])
return false unless role_validator.valid?(@role)
true
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] role Object to be assigned
def role=(role)
validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"])
unless validator.valid?(role)
fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
end
@role = role
end

# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
Expand Down
36 changes: 1 addition & 35 deletions lib/tremendous/models/create_member_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,9 @@ class CreateMemberRequest
# Email address of the member
attr_accessor :email

# Role of the member within the organization. <table> <thead> <tr> <th>Role</th> <th>Description</th> </tr> </thead> <tr> <td><code>MEMBER</code></td> <td>Limited permissions. Can view their own reward and order histories only.</td> </tr> <tr> <td><code>ADMIN</code></td> <td>Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.</td> </tr> <tbody> </table>
# The role ID of the member within the organization.
attr_accessor :role

class EnumAttributeValidator
attr_reader :datatype
attr_reader :allowable_values

def initialize(datatype, allowable_values)
@allowable_values = allowable_values.map do |value|
case datatype.to_s
when /Integer/i
value.to_i
when /Float/i
value.to_f
else
value
end
end
end

def valid?(value)
!value || allowable_values.include?(value)
end
end

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
Expand Down Expand Up @@ -120,21 +98,9 @@ def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
return false if @email.nil?
return false if @role.nil?
role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"])
return false unless role_validator.valid?(@role)
true
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] role Object to be assigned
def role=(role)
validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"])
unless validator.valid?(role)
fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
end
@role = role
end

# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
Expand Down
16 changes: 14 additions & 2 deletions lib/tremendous/models/create_organization_request_copy_settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ class CreateOrganizationRequestCopySettings
# Copy over the security settings from the current organization to the new organization. Defaults to `true`.
attr_accessor :security_settings

# Copy over the users from the current organization to the new organization. Defaults to `false`.
# Copy over the users and custom roles from the current organization to the new organization. Defaults to `false`.
attr_accessor :users

# Copy over the custom roles from the current organization to the new organization. Custom roles are always copied if `users` is `true`. Defaults to `false`.
attr_accessor :custom_roles

# Copy over the fraud prevention settings and rules from the current organization to the new organization. Defaults to `false`.
attr_accessor :fraud_prevention

Expand All @@ -46,6 +49,7 @@ def self.attribute_map
:'payment_methods' => :'payment_methods',
:'security_settings' => :'security_settings',
:'users' => :'users',
:'custom_roles' => :'custom_roles',
:'fraud_prevention' => :'fraud_prevention'
}
end
Expand All @@ -64,6 +68,7 @@ def self.openapi_types
:'payment_methods' => :'Boolean',
:'security_settings' => :'Boolean',
:'users' => :'Boolean',
:'custom_roles' => :'Boolean',
:'fraud_prevention' => :'Boolean'
}
end
Expand Down Expand Up @@ -125,6 +130,12 @@ def initialize(attributes = {})
self.users = false
end

if attributes.key?(:'custom_roles')
self.custom_roles = attributes[:'custom_roles']
else
self.custom_roles = false
end

if attributes.key?(:'fraud_prevention')
self.fraud_prevention = attributes[:'fraud_prevention']
else
Expand Down Expand Up @@ -158,6 +169,7 @@ def ==(o)
payment_methods == o.payment_methods &&
security_settings == o.security_settings &&
users == o.users &&
custom_roles == o.custom_roles &&
fraud_prevention == o.fraud_prevention
end

Expand All @@ -170,7 +182,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[campaigns, custom_fields, order_approvals, payment_methods, security_settings, users, fraud_prevention].hash
[campaigns, custom_fields, order_approvals, payment_methods, security_settings, users, custom_roles, fraud_prevention].hash
end

# Builds the object from hash
Expand Down
Loading

0 comments on commit 81ea4d7

Please sign in to comment.