permit-sdk 0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/api/api.rb +25 -0
- data/lib/api/base.rb +26 -0
- data/lib/api/resources.rb +13 -0
- data/lib/api/tenants.rb +11 -0
- data/lib/api/users.rb +50 -0
- data/lib/config.rb +23 -0
- data/lib/openapi_client/api/api_keys_api.rb +413 -0
- data/lib/openapi_client/api/audit_elements_data_api.rb +118 -0
- data/lib/openapi_client/api/audit_logs_api.rb +204 -0
- data/lib/openapi_client/api/authentication_api.rb +512 -0
- data/lib/openapi_client/api/condition_set_rules_api.rb +278 -0
- data/lib/openapi_client/api/condition_sets_api.rb +428 -0
- data/lib/openapi_client/api/decision_logs_api.rb +128 -0
- data/lib/openapi_client/api/decision_logs_ingress_api.rb +90 -0
- data/lib/openapi_client/api/default_api.rb +297 -0
- data/lib/openapi_client/api/elements_configs_api.rb +657 -0
- data/lib/openapi_client/api/environments_api.rb +462 -0
- data/lib/openapi_client/api/instructions_api.rb +91 -0
- data/lib/openapi_client/api/members_api.rb +354 -0
- data/lib/openapi_client/api/opal_data_api.rb +343 -0
- data/lib/openapi_client/api/organizations_api.rb +652 -0
- data/lib/openapi_client/api/policy_api.rb +138 -0
- data/lib/openapi_client/api/policy_decision_points_api.rb +382 -0
- data/lib/openapi_client/api/policy_git_repositories_api.rb +510 -0
- data/lib/openapi_client/api/projects_api.rb +365 -0
- data/lib/openapi_client/api/resource_actions_api.rb +455 -0
- data/lib/openapi_client/api/resource_attributes_api.rb +473 -0
- data/lib/openapi_client/api/resource_instances_api.rb +425 -0
- data/lib/openapi_client/api/resource_roles_api.rb +813 -0
- data/lib/openapi_client/api/resources_api.rb +514 -0
- data/lib/openapi_client/api/role_assignments_api.rb +278 -0
- data/lib/openapi_client/api/roles_api.rb +759 -0
- data/lib/openapi_client/api/tenants_api.rb +603 -0
- data/lib/openapi_client/api/user_attributes_api.rb +458 -0
- data/lib/openapi_client/api/users_api.rb +684 -0
- data/lib/openapi_client/api/users_elements_data_api.rb +638 -0
- data/lib/openapi_client/api_client.rb +392 -0
- data/lib/openapi_client/api_error.rb +57 -0
- data/lib/openapi_client/configuration.rb +280 -0
- data/lib/openapi_client/models/action_block_editable.rb +230 -0
- data/lib/openapi_client/models/action_block_read.rb +255 -0
- data/lib/openapi_client/models/action_object.rb +275 -0
- data/lib/openapi_client/models/actor.rb +57 -0
- data/lib/openapi_client/models/add_role_permissions.rb +227 -0
- data/lib/openapi_client/models/api_key_create.rb +269 -0
- data/lib/openapi_client/models/api_key_owner_type.rb +41 -0
- data/lib/openapi_client/models/api_key_read.rb +329 -0
- data/lib/openapi_client/models/api_key_scope_read.rb +245 -0
- data/lib/openapi_client/models/attribute_block_editable.rb +235 -0
- data/lib/openapi_client/models/attribute_block_read.rb +260 -0
- data/lib/openapi_client/models/attribute_type.rb +44 -0
- data/lib/openapi_client/models/attributes.rb +231 -0
- data/lib/openapi_client/models/audit_log.rb +415 -0
- data/lib/openapi_client/models/audit_log_objects.rb +282 -0
- data/lib/openapi_client/models/authn_me_api_key_read.rb +329 -0
- data/lib/openapi_client/models/authn_me_member_read.rb +352 -0
- data/lib/openapi_client/models/authn_me_read.rb +224 -0
- data/lib/openapi_client/models/authn_me_user_read.rb +440 -0
- data/lib/openapi_client/models/condition_set_create.rb +340 -0
- data/lib/openapi_client/models/condition_set_read.rb +409 -0
- data/lib/openapi_client/models/condition_set_rule_create.rb +279 -0
- data/lib/openapi_client/models/condition_set_rule_read.rb +360 -0
- data/lib/openapi_client/models/condition_set_rule_remove.rb +279 -0
- data/lib/openapi_client/models/condition_set_type.rb +40 -0
- data/lib/openapi_client/models/condition_set_update.rb +255 -0
- data/lib/openapi_client/models/data_source_config.rb +228 -0
- data/lib/openapi_client/models/data_source_entry.rb +272 -0
- data/lib/openapi_client/models/detailed_audit_log.rb +443 -0
- data/lib/openapi_client/models/dev_login.rb +225 -0
- data/lib/openapi_client/models/dummy_engine_model.rb +229 -0
- data/lib/openapi_client/models/elements_config_create.rb +319 -0
- data/lib/openapi_client/models/elements_config_read.rb +402 -0
- data/lib/openapi_client/models/elements_config_runtime_read.rb +238 -0
- data/lib/openapi_client/models/elements_config_update.rb +268 -0
- data/lib/openapi_client/models/elements_env_type_read.rb +242 -0
- data/lib/openapi_client/models/elements_env_type_update.rb +222 -0
- data/lib/openapi_client/models/elements_permission_level.rb +44 -0
- data/lib/openapi_client/models/elements_role_read.rb +378 -0
- data/lib/openapi_client/models/elements_type.rb +41 -0
- data/lib/openapi_client/models/elements_user_create.rb +295 -0
- data/lib/openapi_client/models/elements_user_role_create.rb +225 -0
- data/lib/openapi_client/models/elements_user_role_remove.rb +225 -0
- data/lib/openapi_client/models/embedded_login_request_output.rb +265 -0
- data/lib/openapi_client/models/engine.rb +39 -0
- data/lib/openapi_client/models/environment_create.rb +281 -0
- data/lib/openapi_client/models/environment_object.rb +295 -0
- data/lib/openapi_client/models/environment_read.rb +335 -0
- data/lib/openapi_client/models/environment_stats.rb +365 -0
- data/lib/openapi_client/models/environment_update.rb +240 -0
- data/lib/openapi_client/models/failed_invite.rb +238 -0
- data/lib/openapi_client/models/full_data.rb +258 -0
- data/lib/openapi_client/models/http_validation_error.rb +221 -0
- data/lib/openapi_client/models/identity_read.rb +300 -0
- data/lib/openapi_client/models/invite_attempt_result.rb +232 -0
- data/lib/openapi_client/models/invite_create.rb +240 -0
- data/lib/openapi_client/models/invite_read.rb +325 -0
- data/lib/openapi_client/models/invite_status.rb +42 -0
- data/lib/openapi_client/models/labels.rb +238 -0
- data/lib/openapi_client/models/language_instructions.rb +252 -0
- data/lib/openapi_client/models/location_inner.rb +230 -0
- data/lib/openapi_client/models/login_result.rb +259 -0
- data/lib/openapi_client/models/member_access_level.rb +41 -0
- data/lib/openapi_client/models/member_access_obj.rb +41 -0
- data/lib/openapi_client/models/multi_invite_result.rb +238 -0
- data/lib/openapi_client/models/onboarding_step.rb +46 -0
- data/lib/openapi_client/models/opa_decision_log.rb +288 -0
- data/lib/openapi_client/models/opa_engine_decision_log.rb +345 -0
- data/lib/openapi_client/models/opa_labels.rb +238 -0
- data/lib/openapi_client/models/opa_metrics.rb +273 -0
- data/lib/openapi_client/models/opal_client.rb +305 -0
- data/lib/openapi_client/models/org_member_read.rb +420 -0
- data/lib/openapi_client/models/org_member_update.rb +230 -0
- data/lib/openapi_client/models/organization_create.rb +292 -0
- data/lib/openapi_client/models/organization_object.rb +295 -0
- data/lib/openapi_client/models/organization_read.rb +295 -0
- data/lib/openapi_client/models/organization_read_with_api_key.rb +313 -0
- data/lib/openapi_client/models/organization_update.rb +247 -0
- data/lib/openapi_client/models/paginated_result_api_key_read.rb +285 -0
- data/lib/openapi_client/models/paginated_result_audit_log.rb +285 -0
- data/lib/openapi_client/models/paginated_result_elements_config_read.rb +285 -0
- data/lib/openapi_client/models/paginated_result_opa_decision_log.rb +285 -0
- data/lib/openapi_client/models/paginated_result_user_read.rb +285 -0
- data/lib/openapi_client/models/pdp.rb +259 -0
- data/lib/openapi_client/models/pdp_config_object.rb +258 -0
- data/lib/openapi_client/models/pdp_config_read.rb +292 -0
- data/lib/openapi_client/models/pdp_context.rb +291 -0
- data/lib/openapi_client/models/pdp_state.rb +224 -0
- data/lib/openapi_client/models/pdp_state_update.rb +238 -0
- data/lib/openapi_client/models/pdp_values.rb +252 -0
- data/lib/openapi_client/models/permission_level_role_read.rb +254 -0
- data/lib/openapi_client/models/policy_repo_create.rb +318 -0
- data/lib/openapi_client/models/policy_repo_read.rb +347 -0
- data/lib/openapi_client/models/policy_repo_status.rb +41 -0
- data/lib/openapi_client/models/programming_language.rb +43 -0
- data/lib/openapi_client/models/project_create.rb +318 -0
- data/lib/openapi_client/models/project_object.rb +295 -0
- data/lib/openapi_client/models/project_read.rb +357 -0
- data/lib/openapi_client/models/project_update.rb +250 -0
- data/lib/openapi_client/models/raw_data.rb +329 -0
- data/lib/openapi_client/models/relationship_tuple_object.rb +252 -0
- data/lib/openapi_client/models/remote_config.rb +256 -0
- data/lib/openapi_client/models/remove_role_permissions.rb +227 -0
- data/lib/openapi_client/models/resource_action_create.rb +271 -0
- data/lib/openapi_client/models/resource_action_read.rb +370 -0
- data/lib/openapi_client/models/resource_action_update.rb +230 -0
- data/lib/openapi_client/models/resource_attribute_create.rb +271 -0
- data/lib/openapi_client/models/resource_attribute_read.rb +370 -0
- data/lib/openapi_client/models/resource_attribute_update.rb +230 -0
- data/lib/openapi_client/models/resource_attributes.rb +238 -0
- data/lib/openapi_client/models/resource_create.rb +310 -0
- data/lib/openapi_client/models/resource_id.rb +230 -0
- data/lib/openapi_client/models/resource_instance_create.rb +281 -0
- data/lib/openapi_client/models/resource_instance_read.rb +375 -0
- data/lib/openapi_client/models/resource_instance_update.rb +220 -0
- data/lib/openapi_client/models/resource_read.rb +374 -0
- data/lib/openapi_client/models/resource_replace.rb +274 -0
- data/lib/openapi_client/models/resource_role_create.rb +295 -0
- data/lib/openapi_client/models/resource_role_read.rb +379 -0
- data/lib/openapi_client/models/resource_role_update.rb +254 -0
- data/lib/openapi_client/models/resource_type_object.rb +286 -0
- data/lib/openapi_client/models/resource_update.rb +264 -0
- data/lib/openapi_client/models/role_assignment_create.rb +255 -0
- data/lib/openapi_client/models/role_assignment_read.rb +375 -0
- data/lib/openapi_client/models/role_assignment_remove.rb +255 -0
- data/lib/openapi_client/models/role_block.rb +244 -0
- data/lib/openapi_client/models/role_create.rb +295 -0
- data/lib/openapi_client/models/role_data.rb +221 -0
- data/lib/openapi_client/models/role_read.rb +364 -0
- data/lib/openapi_client/models/role_update.rb +254 -0
- data/lib/openapi_client/models/settings.rb +231 -0
- data/lib/openapi_client/models/ssh_auth_data.rb +295 -0
- data/lib/openapi_client/models/statistics.rb +389 -0
- data/lib/openapi_client/models/tenant_create.rb +281 -0
- data/lib/openapi_client/models/tenant_object.rb +284 -0
- data/lib/openapi_client/models/tenant_read.rb +365 -0
- data/lib/openapi_client/models/tenant_update.rb +240 -0
- data/lib/openapi_client/models/user_create.rb +286 -0
- data/lib/openapi_client/models/user_data.rb +232 -0
- data/lib/openapi_client/models/user_login_request_input.rb +240 -0
- data/lib/openapi_client/models/user_object.rb +313 -0
- data/lib/openapi_client/models/user_read.rb +336 -0
- data/lib/openapi_client/models/user_role.rb +240 -0
- data/lib/openapi_client/models/user_role_create.rb +240 -0
- data/lib/openapi_client/models/user_role_remove.rb +240 -0
- data/lib/openapi_client/models/user_update.rb +250 -0
- data/lib/openapi_client/models/validation_error.rb +254 -0
- data/lib/openapi_client/models/webhook_create.rb +235 -0
- data/lib/openapi_client/models/webhook_read.rb +315 -0
- data/lib/openapi_client/models/webhook_update.rb +230 -0
- data/lib/openapi_client/version.rb +15 -0
- data/lib/openapi_client.rb +220 -0
- data/lib/permit.rb +58 -0
- metadata +249 -0
| @@ -0,0 +1,319 @@ | |
| 1 | 
            +
            =begin
         | 
| 2 | 
            +
            #Permit.io API
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            # Authorization as a service 
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            The version of the OpenAPI document: 2.0.0
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            Generated by: https://openapi-generator.tech
         | 
| 9 | 
            +
            OpenAPI Generator version: 6.2.1
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            =end
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            require 'date'
         | 
| 14 | 
            +
            require 'time'
         | 
| 15 | 
            +
             | 
| 16 | 
            +
            module OpenapiClient
         | 
| 17 | 
            +
              class ElementsConfigCreate
         | 
| 18 | 
            +
                # A URL-friendly name of the elements_config (i.e: slug). You will be able to query later using this key instead of the id (UUID) of the elements_config.
         | 
| 19 | 
            +
                attr_accessor :key
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                # The name of the elements_config
         | 
| 22 | 
            +
                attr_accessor :name
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                # The type of the elements interface, e.g: user management
         | 
| 25 | 
            +
                attr_accessor :elements_type
         | 
| 26 | 
            +
             | 
| 27 | 
            +
                # Obj with the options of the elements interface, e.g: primary color
         | 
| 28 | 
            +
                attr_accessor :settings
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                # Obj with levels as keys and role ids as values
         | 
| 31 | 
            +
                attr_accessor :roles_to_levels
         | 
| 32 | 
            +
             | 
| 33 | 
            +
                attr_accessor :webhook
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                # Attribute mapping from ruby-style variable name to JSON key.
         | 
| 36 | 
            +
                def self.attribute_map
         | 
| 37 | 
            +
                  {
         | 
| 38 | 
            +
                    :'key' => :'key',
         | 
| 39 | 
            +
                    :'name' => :'name',
         | 
| 40 | 
            +
                    :'elements_type' => :'elements_type',
         | 
| 41 | 
            +
                    :'settings' => :'settings',
         | 
| 42 | 
            +
                    :'roles_to_levels' => :'roles_to_levels',
         | 
| 43 | 
            +
                    :'webhook' => :'webhook'
         | 
| 44 | 
            +
                  }
         | 
| 45 | 
            +
                end
         | 
| 46 | 
            +
             | 
| 47 | 
            +
                # Returns all the JSON keys this model knows about
         | 
| 48 | 
            +
                def self.acceptable_attributes
         | 
| 49 | 
            +
                  attribute_map.values
         | 
| 50 | 
            +
                end
         | 
| 51 | 
            +
             | 
| 52 | 
            +
                # Attribute type mapping.
         | 
| 53 | 
            +
                def self.openapi_types
         | 
| 54 | 
            +
                  {
         | 
| 55 | 
            +
                    :'key' => :'String',
         | 
| 56 | 
            +
                    :'name' => :'String',
         | 
| 57 | 
            +
                    :'elements_type' => :'ElementsType',
         | 
| 58 | 
            +
                    :'settings' => :'Hash<String, Settings>',
         | 
| 59 | 
            +
                    :'roles_to_levels' => :'Hash<String, Array<String>>',
         | 
| 60 | 
            +
                    :'webhook' => :'WebhookCreate'
         | 
| 61 | 
            +
                  }
         | 
| 62 | 
            +
                end
         | 
| 63 | 
            +
             | 
| 64 | 
            +
                # List of attributes with nullable: true
         | 
| 65 | 
            +
                def self.openapi_nullable
         | 
| 66 | 
            +
                  Set.new([
         | 
| 67 | 
            +
                  ])
         | 
| 68 | 
            +
                end
         | 
| 69 | 
            +
             | 
| 70 | 
            +
                # Initializes the object
         | 
| 71 | 
            +
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 72 | 
            +
                def initialize(attributes = {})
         | 
| 73 | 
            +
                  if (!attributes.is_a?(Hash))
         | 
| 74 | 
            +
                    fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::ElementsConfigCreate` initialize method"
         | 
| 75 | 
            +
                  end
         | 
| 76 | 
            +
             | 
| 77 | 
            +
                  # check to see if the attribute exists and convert string to symbol for hash key
         | 
| 78 | 
            +
                  attributes = attributes.each_with_object({}) { |(k, v), h|
         | 
| 79 | 
            +
                    if (!self.class.attribute_map.key?(k.to_sym))
         | 
| 80 | 
            +
                      fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::ElementsConfigCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
         | 
| 81 | 
            +
                    end
         | 
| 82 | 
            +
                    h[k.to_sym] = v
         | 
| 83 | 
            +
                  }
         | 
| 84 | 
            +
             | 
| 85 | 
            +
                  if attributes.key?(:'key')
         | 
| 86 | 
            +
                    self.key = attributes[:'key']
         | 
| 87 | 
            +
                  end
         | 
| 88 | 
            +
             | 
| 89 | 
            +
                  if attributes.key?(:'name')
         | 
| 90 | 
            +
                    self.name = attributes[:'name']
         | 
| 91 | 
            +
                  end
         | 
| 92 | 
            +
             | 
| 93 | 
            +
                  if attributes.key?(:'elements_type')
         | 
| 94 | 
            +
                    self.elements_type = attributes[:'elements_type']
         | 
| 95 | 
            +
                  end
         | 
| 96 | 
            +
             | 
| 97 | 
            +
                  if attributes.key?(:'settings')
         | 
| 98 | 
            +
                    if (value = attributes[:'settings']).is_a?(Hash)
         | 
| 99 | 
            +
                      self.settings = value
         | 
| 100 | 
            +
                    end
         | 
| 101 | 
            +
                  end
         | 
| 102 | 
            +
             | 
| 103 | 
            +
                  if attributes.key?(:'roles_to_levels')
         | 
| 104 | 
            +
                    if (value = attributes[:'roles_to_levels']).is_a?(Hash)
         | 
| 105 | 
            +
                      self.roles_to_levels = value
         | 
| 106 | 
            +
                    end
         | 
| 107 | 
            +
                  end
         | 
| 108 | 
            +
             | 
| 109 | 
            +
                  if attributes.key?(:'webhook')
         | 
| 110 | 
            +
                    self.webhook = attributes[:'webhook']
         | 
| 111 | 
            +
                  end
         | 
| 112 | 
            +
                end
         | 
| 113 | 
            +
             | 
| 114 | 
            +
                # Show invalid properties with the reasons. Usually used together with valid?
         | 
| 115 | 
            +
                # @return Array for valid properties with the reasons
         | 
| 116 | 
            +
                def list_invalid_properties
         | 
| 117 | 
            +
                  invalid_properties = Array.new
         | 
| 118 | 
            +
                  if @key.nil?
         | 
| 119 | 
            +
                    invalid_properties.push('invalid value for "key", key cannot be nil.')
         | 
| 120 | 
            +
                  end
         | 
| 121 | 
            +
             | 
| 122 | 
            +
                  pattern = Regexp.new(/^[A-Za-z0-9\-_]+$/)
         | 
| 123 | 
            +
                  if @key !~ pattern
         | 
| 124 | 
            +
                    invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
         | 
| 125 | 
            +
                  end
         | 
| 126 | 
            +
             | 
| 127 | 
            +
                  if @name.nil?
         | 
| 128 | 
            +
                    invalid_properties.push('invalid value for "name", name cannot be nil.')
         | 
| 129 | 
            +
                  end
         | 
| 130 | 
            +
             | 
| 131 | 
            +
                  if @elements_type.nil?
         | 
| 132 | 
            +
                    invalid_properties.push('invalid value for "elements_type", elements_type cannot be nil.')
         | 
| 133 | 
            +
                  end
         | 
| 134 | 
            +
             | 
| 135 | 
            +
                  if @settings.nil?
         | 
| 136 | 
            +
                    invalid_properties.push('invalid value for "settings", settings cannot be nil.')
         | 
| 137 | 
            +
                  end
         | 
| 138 | 
            +
             | 
| 139 | 
            +
                  if @roles_to_levels.nil?
         | 
| 140 | 
            +
                    invalid_properties.push('invalid value for "roles_to_levels", roles_to_levels cannot be nil.')
         | 
| 141 | 
            +
                  end
         | 
| 142 | 
            +
             | 
| 143 | 
            +
                  invalid_properties
         | 
| 144 | 
            +
                end
         | 
| 145 | 
            +
             | 
| 146 | 
            +
                # Check to see if the all the properties in the model are valid
         | 
| 147 | 
            +
                # @return true if the model is valid
         | 
| 148 | 
            +
                def valid?
         | 
| 149 | 
            +
                  return false if @key.nil?
         | 
| 150 | 
            +
                  return false if @key !~ Regexp.new(/^[A-Za-z0-9\-_]+$/)
         | 
| 151 | 
            +
                  return false if @name.nil?
         | 
| 152 | 
            +
                  return false if @elements_type.nil?
         | 
| 153 | 
            +
                  return false if @settings.nil?
         | 
| 154 | 
            +
                  return false if @roles_to_levels.nil?
         | 
| 155 | 
            +
                  true
         | 
| 156 | 
            +
                end
         | 
| 157 | 
            +
             | 
| 158 | 
            +
                # Custom attribute writer method with validation
         | 
| 159 | 
            +
                # @param [Object] key Value to be assigned
         | 
| 160 | 
            +
                def key=(key)
         | 
| 161 | 
            +
                  if key.nil?
         | 
| 162 | 
            +
                    fail ArgumentError, 'key cannot be nil'
         | 
| 163 | 
            +
                  end
         | 
| 164 | 
            +
             | 
| 165 | 
            +
                  pattern = Regexp.new(/^[A-Za-z0-9\-_]+$/)
         | 
| 166 | 
            +
                  if key !~ pattern
         | 
| 167 | 
            +
                    fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
         | 
| 168 | 
            +
                  end
         | 
| 169 | 
            +
             | 
| 170 | 
            +
                  @key = key
         | 
| 171 | 
            +
                end
         | 
| 172 | 
            +
             | 
| 173 | 
            +
                # Checks equality by comparing each attribute.
         | 
| 174 | 
            +
                # @param [Object] Object to be compared
         | 
| 175 | 
            +
                def ==(o)
         | 
| 176 | 
            +
                  return true if self.equal?(o)
         | 
| 177 | 
            +
                  self.class == o.class &&
         | 
| 178 | 
            +
                      key == o.key &&
         | 
| 179 | 
            +
                      name == o.name &&
         | 
| 180 | 
            +
                      elements_type == o.elements_type &&
         | 
| 181 | 
            +
                      settings == o.settings &&
         | 
| 182 | 
            +
                      roles_to_levels == o.roles_to_levels &&
         | 
| 183 | 
            +
                      webhook == o.webhook
         | 
| 184 | 
            +
                end
         | 
| 185 | 
            +
             | 
| 186 | 
            +
                # @see the `==` method
         | 
| 187 | 
            +
                # @param [Object] Object to be compared
         | 
| 188 | 
            +
                def eql?(o)
         | 
| 189 | 
            +
                  self == o
         | 
| 190 | 
            +
                end
         | 
| 191 | 
            +
             | 
| 192 | 
            +
                # Calculates hash code according to all attributes.
         | 
| 193 | 
            +
                # @return [Integer] Hash code
         | 
| 194 | 
            +
                def hash
         | 
| 195 | 
            +
                  [key, name, elements_type, settings, roles_to_levels, webhook].hash
         | 
| 196 | 
            +
                end
         | 
| 197 | 
            +
             | 
| 198 | 
            +
                # Builds the object from hash
         | 
| 199 | 
            +
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 200 | 
            +
                # @return [Object] Returns the model itself
         | 
| 201 | 
            +
                def self.build_from_hash(attributes)
         | 
| 202 | 
            +
                  new.build_from_hash(attributes)
         | 
| 203 | 
            +
                end
         | 
| 204 | 
            +
             | 
| 205 | 
            +
                # Builds the object from hash
         | 
| 206 | 
            +
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 207 | 
            +
                # @return [Object] Returns the model itself
         | 
| 208 | 
            +
                def build_from_hash(attributes)
         | 
| 209 | 
            +
                  return nil unless attributes.is_a?(Hash)
         | 
| 210 | 
            +
                  attributes = attributes.transform_keys(&:to_sym)
         | 
| 211 | 
            +
                  self.class.openapi_types.each_pair do |key, type|
         | 
| 212 | 
            +
                    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
         | 
| 213 | 
            +
                      self.send("#{key}=", nil)
         | 
| 214 | 
            +
                    elsif type =~ /\AArray<(.*)>/i
         | 
| 215 | 
            +
                      # check to ensure the input is an array given that the attribute
         | 
| 216 | 
            +
                      # is documented as an array but the input is not
         | 
| 217 | 
            +
                      if attributes[self.class.attribute_map[key]].is_a?(Array)
         | 
| 218 | 
            +
                        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
         | 
| 219 | 
            +
                      end
         | 
| 220 | 
            +
                    elsif !attributes[self.class.attribute_map[key]].nil?
         | 
| 221 | 
            +
                      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
         | 
| 222 | 
            +
                    end
         | 
| 223 | 
            +
                  end
         | 
| 224 | 
            +
             | 
| 225 | 
            +
                  self
         | 
| 226 | 
            +
                end
         | 
| 227 | 
            +
             | 
| 228 | 
            +
                # Deserializes the data based on type
         | 
| 229 | 
            +
                # @param string type Data type
         | 
| 230 | 
            +
                # @param string value Value to be deserialized
         | 
| 231 | 
            +
                # @return [Object] Deserialized data
         | 
| 232 | 
            +
                def _deserialize(type, value)
         | 
| 233 | 
            +
                  case type.to_sym
         | 
| 234 | 
            +
                  when :Time
         | 
| 235 | 
            +
                    Time.parse(value)
         | 
| 236 | 
            +
                  when :Date
         | 
| 237 | 
            +
                    Date.parse(value)
         | 
| 238 | 
            +
                  when :String
         | 
| 239 | 
            +
                    value.to_s
         | 
| 240 | 
            +
                  when :Integer
         | 
| 241 | 
            +
                    value.to_i
         | 
| 242 | 
            +
                  when :Float
         | 
| 243 | 
            +
                    value.to_f
         | 
| 244 | 
            +
                  when :Boolean
         | 
| 245 | 
            +
                    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
         | 
| 246 | 
            +
                      true
         | 
| 247 | 
            +
                    else
         | 
| 248 | 
            +
                      false
         | 
| 249 | 
            +
                    end
         | 
| 250 | 
            +
                  when :Object
         | 
| 251 | 
            +
                    # generic object (usually a Hash), return directly
         | 
| 252 | 
            +
                    value
         | 
| 253 | 
            +
                  when /\AArray<(?<inner_type>.+)>\z/
         | 
| 254 | 
            +
                    inner_type = Regexp.last_match[:inner_type]
         | 
| 255 | 
            +
                    value.map { |v| _deserialize(inner_type, v) }
         | 
| 256 | 
            +
                  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
         | 
| 257 | 
            +
                    k_type = Regexp.last_match[:k_type]
         | 
| 258 | 
            +
                    v_type = Regexp.last_match[:v_type]
         | 
| 259 | 
            +
                    {}.tap do |hash|
         | 
| 260 | 
            +
                      value.each do |k, v|
         | 
| 261 | 
            +
                        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
         | 
| 262 | 
            +
                      end
         | 
| 263 | 
            +
                    end
         | 
| 264 | 
            +
                  else # model
         | 
| 265 | 
            +
                    # models (e.g. Pet) or oneOf
         | 
| 266 | 
            +
                    klass = OpenapiClient.const_get(type)
         | 
| 267 | 
            +
                    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         | 
| 268 | 
            +
                  end
         | 
| 269 | 
            +
                end
         | 
| 270 | 
            +
             | 
| 271 | 
            +
                # Returns the string representation of the object
         | 
| 272 | 
            +
                # @return [String] String presentation of the object
         | 
| 273 | 
            +
                def to_s
         | 
| 274 | 
            +
                  to_hash.to_s
         | 
| 275 | 
            +
                end
         | 
| 276 | 
            +
             | 
| 277 | 
            +
                # to_body is an alias to to_hash (backward compatibility)
         | 
| 278 | 
            +
                # @return [Hash] Returns the object in the form of hash
         | 
| 279 | 
            +
                def to_body
         | 
| 280 | 
            +
                  to_hash
         | 
| 281 | 
            +
                end
         | 
| 282 | 
            +
             | 
| 283 | 
            +
                # Returns the object in the form of hash
         | 
| 284 | 
            +
                # @return [Hash] Returns the object in the form of hash
         | 
| 285 | 
            +
                def to_hash
         | 
| 286 | 
            +
                  hash = {}
         | 
| 287 | 
            +
                  self.class.attribute_map.each_pair do |attr, param|
         | 
| 288 | 
            +
                    value = self.send(attr)
         | 
| 289 | 
            +
                    if value.nil?
         | 
| 290 | 
            +
                      is_nullable = self.class.openapi_nullable.include?(attr)
         | 
| 291 | 
            +
                      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
         | 
| 292 | 
            +
                    end
         | 
| 293 | 
            +
             | 
| 294 | 
            +
                    hash[param] = _to_hash(value)
         | 
| 295 | 
            +
                  end
         | 
| 296 | 
            +
                  hash
         | 
| 297 | 
            +
                end
         | 
| 298 | 
            +
             | 
| 299 | 
            +
                # Outputs non-array value in the form of hash
         | 
| 300 | 
            +
                # For object, use to_hash. Otherwise, just return the value
         | 
| 301 | 
            +
                # @param [Object] value Any valid value
         | 
| 302 | 
            +
                # @return [Hash] Returns the value in the form of hash
         | 
| 303 | 
            +
                def _to_hash(value)
         | 
| 304 | 
            +
                  if value.is_a?(Array)
         | 
| 305 | 
            +
                    value.compact.map { |v| _to_hash(v) }
         | 
| 306 | 
            +
                  elsif value.is_a?(Hash)
         | 
| 307 | 
            +
                    {}.tap do |hash|
         | 
| 308 | 
            +
                      value.each { |k, v| hash[k] = _to_hash(v) }
         | 
| 309 | 
            +
                    end
         | 
| 310 | 
            +
                  elsif value.respond_to? :to_hash
         | 
| 311 | 
            +
                    value.to_hash
         | 
| 312 | 
            +
                  else
         | 
| 313 | 
            +
                    value
         | 
| 314 | 
            +
                  end
         | 
| 315 | 
            +
                end
         | 
| 316 | 
            +
             | 
| 317 | 
            +
              end
         | 
| 318 | 
            +
             | 
| 319 | 
            +
            end
         |