=begin #Yousign API Swagger #For your information, the Yousign API documentation is available at https://dev.yousign.com/ OpenAPI spec version: 2.1 Contact: support@yousign.fr Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.14 =end require 'date' module YousignClient class OrganizationOutput # Organization ID attr_accessor :id # Organization name attr_accessor :name # Custom URL for the Organization (internal usage only, should not be used) attr_accessor :url # Created date of the object attr_accessor :created_at # Updated date of the object attr_accessor :updated_at # Internal usage, should not be used attr_accessor :f_sso # Internal usage, should not be used attr_accessor :max_users # Defined if the organization anable the related files attr_accessor :procedure_related_files_enable attr_accessor :subscriptions # Internal usage, should not be used attr_accessor :auto_collection # Internal usage, should not be used attr_accessor :vat_number attr_accessor :billing_address # Internal usage, should not be used attr_accessor :in_app_support # Internal usage, should not be used attr_accessor :in_app_updates # Internal usage, should not be used attr_accessor :file_template # Internal usage, should not be used attr_accessor :f_archive # Internal usage, should not be used attr_accessor :f_user_permissions # Internal usage, should not be used attr_accessor :f_procedure_template # Internal usage, should not be used attr_accessor :f_procedure_reminder_auto # Internal usage, should not be used attr_accessor :f_api # Internal usage, should not be used attr_accessor :f_checkdocument # Internal usage, should not be used attr_accessor :f_procedure_create # Internal usage, should not be used attr_accessor :f_signature_ui # Internal usage, should not be used attr_accessor :f_server_stamp # Internal usage, should not be used attr_accessor :f_operation_level_none # Internal usage, should not be used attr_accessor :f_consent_process # Internal usage, should not be used attr_accessor :f_operation_level_advanced # Internal usage, should not be used attr_accessor :f_operation_custom_mode_email # Internal usage, should not be used attr_accessor :f_dynamic_fields # Internal usage, should not be used attr_accessor :saml_identity_provider # Pattern of the password policy for the organization attr_accessor :password_policy_pattern # Description for the password policy attr_accessor :password_policy_description # Internal usage, should not be used attr_accessor :user_activation # Internal usage, should not be used attr_accessor :f_procedure_template_permissions # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'id' => :'id', :'name' => :'name', :'url' => :'url', :'created_at' => :'createdAt', :'updated_at' => :'updatedAt', :'f_sso' => :'fSso', :'max_users' => :'maxUsers', :'procedure_related_files_enable' => :'procedureRelatedFilesEnable', :'subscriptions' => :'subscriptions', :'auto_collection' => :'autoCollection', :'vat_number' => :'vatNumber', :'billing_address' => :'billingAddress', :'in_app_support' => :'inAppSupport', :'in_app_updates' => :'inAppUpdates', :'file_template' => :'fileTemplate', :'f_archive' => :'fArchive', :'f_user_permissions' => :'fUserPermissions', :'f_procedure_template' => :'fProcedureTemplate', :'f_procedure_reminder_auto' => :'fProcedureReminderAuto', :'f_api' => :'fApi', :'f_checkdocument' => :'fCheckdocument', :'f_procedure_create' => :'fProcedureCreate', :'f_signature_ui' => :'fSignatureUi', :'f_server_stamp' => :'fServerStamp', :'f_operation_level_none' => :'fOperationLevelNone', :'f_consent_process' => :'fConsentProcess', :'f_operation_level_advanced' => :'fOperationLevelAdvanced', :'f_operation_custom_mode_email' => :'fOperationCustomModeEmail', :'f_dynamic_fields' => :'fDynamicFields', :'saml_identity_provider' => :'samlIdentityProvider', :'password_policy_pattern' => :'passwordPolicyPattern', :'password_policy_description' => :'passwordPolicyDescription', :'user_activation' => :'userActivation', :'f_procedure_template_permissions' => :'fProcedureTemplatePermissions' } end # Attribute type mapping. def self.swagger_types { :'id' => :'String', :'name' => :'String', :'url' => :'String', :'created_at' => :'DateTime', :'updated_at' => :'DateTime', :'f_sso' => :'BOOLEAN', :'max_users' => :'Float', :'procedure_related_files_enable' => :'BOOLEAN', :'subscriptions' => :'Array', :'auto_collection' => :'BOOLEAN', :'vat_number' => :'String', :'billing_address' => :'OrganizationBillingAddress', :'in_app_support' => :'BOOLEAN', :'in_app_updates' => :'String', :'file_template' => :'BOOLEAN', :'f_archive' => :'BOOLEAN', :'f_user_permissions' => :'BOOLEAN', :'f_procedure_template' => :'BOOLEAN', :'f_procedure_reminder_auto' => :'BOOLEAN', :'f_api' => :'BOOLEAN', :'f_checkdocument' => :'BOOLEAN', :'f_procedure_create' => :'BOOLEAN', :'f_signature_ui' => :'BOOLEAN', :'f_server_stamp' => :'BOOLEAN', :'f_operation_level_none' => :'BOOLEAN', :'f_consent_process' => :'BOOLEAN', :'f_operation_level_advanced' => :'BOOLEAN', :'f_operation_custom_mode_email' => :'BOOLEAN', :'f_dynamic_fields' => :'BOOLEAN', :'saml_identity_provider' => :'String', :'password_policy_pattern' => :'String', :'password_policy_description' => :'String', :'user_activation' => :'BOOLEAN', :'f_procedure_template_permissions' => :'BOOLEAN' } end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'id') self.id = attributes[:'id'] end if attributes.has_key?(:'name') self.name = attributes[:'name'] end if attributes.has_key?(:'url') self.url = attributes[:'url'] end if attributes.has_key?(:'createdAt') self.created_at = attributes[:'createdAt'] end if attributes.has_key?(:'updatedAt') self.updated_at = attributes[:'updatedAt'] end if attributes.has_key?(:'fSso') self.f_sso = attributes[:'fSso'] end if attributes.has_key?(:'maxUsers') self.max_users = attributes[:'maxUsers'] end if attributes.has_key?(:'procedureRelatedFilesEnable') self.procedure_related_files_enable = attributes[:'procedureRelatedFilesEnable'] end if attributes.has_key?(:'subscriptions') if (value = attributes[:'subscriptions']).is_a?(Array) self.subscriptions = value end end if attributes.has_key?(:'autoCollection') self.auto_collection = attributes[:'autoCollection'] end if attributes.has_key?(:'vatNumber') self.vat_number = attributes[:'vatNumber'] end if attributes.has_key?(:'billingAddress') self.billing_address = attributes[:'billingAddress'] end if attributes.has_key?(:'inAppSupport') self.in_app_support = attributes[:'inAppSupport'] end if attributes.has_key?(:'inAppUpdates') self.in_app_updates = attributes[:'inAppUpdates'] end if attributes.has_key?(:'fileTemplate') self.file_template = attributes[:'fileTemplate'] end if attributes.has_key?(:'fArchive') self.f_archive = attributes[:'fArchive'] end if attributes.has_key?(:'fUserPermissions') self.f_user_permissions = attributes[:'fUserPermissions'] end if attributes.has_key?(:'fProcedureTemplate') self.f_procedure_template = attributes[:'fProcedureTemplate'] end if attributes.has_key?(:'fProcedureReminderAuto') self.f_procedure_reminder_auto = attributes[:'fProcedureReminderAuto'] end if attributes.has_key?(:'fApi') self.f_api = attributes[:'fApi'] end if attributes.has_key?(:'fCheckdocument') self.f_checkdocument = attributes[:'fCheckdocument'] end if attributes.has_key?(:'fProcedureCreate') self.f_procedure_create = attributes[:'fProcedureCreate'] end if attributes.has_key?(:'fSignatureUi') self.f_signature_ui = attributes[:'fSignatureUi'] end if attributes.has_key?(:'fServerStamp') self.f_server_stamp = attributes[:'fServerStamp'] end if attributes.has_key?(:'fOperationLevelNone') self.f_operation_level_none = attributes[:'fOperationLevelNone'] end if attributes.has_key?(:'fConsentProcess') self.f_consent_process = attributes[:'fConsentProcess'] end if attributes.has_key?(:'fOperationLevelAdvanced') self.f_operation_level_advanced = attributes[:'fOperationLevelAdvanced'] end if attributes.has_key?(:'fOperationCustomModeEmail') self.f_operation_custom_mode_email = attributes[:'fOperationCustomModeEmail'] end if attributes.has_key?(:'fDynamicFields') self.f_dynamic_fields = attributes[:'fDynamicFields'] end if attributes.has_key?(:'samlIdentityProvider') self.saml_identity_provider = attributes[:'samlIdentityProvider'] end if attributes.has_key?(:'passwordPolicyPattern') self.password_policy_pattern = attributes[:'passwordPolicyPattern'] end if attributes.has_key?(:'passwordPolicyDescription') self.password_policy_description = attributes[:'passwordPolicyDescription'] end if attributes.has_key?(:'userActivation') self.user_activation = attributes[:'userActivation'] end if attributes.has_key?(:'fProcedureTemplatePermissions') self.f_procedure_template_permissions = attributes[:'fProcedureTemplatePermissions'] end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new if !@id.nil? && @id !~ Regexp.new(/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/) invalid_properties.push('invalid value for "id", must conform to the pattern /^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.') end invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? return false if !@id.nil? && @id !~ Regexp.new(/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/) true end # Custom attribute writer method with validation # @param [Object] id Value to be assigned def id=(id) if !id.nil? && id !~ Regexp.new(/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/) fail ArgumentError, 'invalid value for "id", must conform to the pattern /^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.' end @id = id end # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && name == o.name && url == o.url && created_at == o.created_at && updated_at == o.updated_at && f_sso == o.f_sso && max_users == o.max_users && procedure_related_files_enable == o.procedure_related_files_enable && subscriptions == o.subscriptions && auto_collection == o.auto_collection && vat_number == o.vat_number && billing_address == o.billing_address && in_app_support == o.in_app_support && in_app_updates == o.in_app_updates && file_template == o.file_template && f_archive == o.f_archive && f_user_permissions == o.f_user_permissions && f_procedure_template == o.f_procedure_template && f_procedure_reminder_auto == o.f_procedure_reminder_auto && f_api == o.f_api && f_checkdocument == o.f_checkdocument && f_procedure_create == o.f_procedure_create && f_signature_ui == o.f_signature_ui && f_server_stamp == o.f_server_stamp && f_operation_level_none == o.f_operation_level_none && f_consent_process == o.f_consent_process && f_operation_level_advanced == o.f_operation_level_advanced && f_operation_custom_mode_email == o.f_operation_custom_mode_email && f_dynamic_fields == o.f_dynamic_fields && saml_identity_provider == o.saml_identity_provider && password_policy_pattern == o.password_policy_pattern && password_policy_description == o.password_policy_description && user_activation == o.user_activation && f_procedure_template_permissions == o.f_procedure_template_permissions end # @see the `==` method # @param [Object] Object to be compared def eql?(o) self == o end # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash [id, name, url, created_at, updated_at, f_sso, max_users, procedure_related_files_enable, subscriptions, auto_collection, vat_number, billing_address, in_app_support, in_app_updates, file_template, f_archive, f_user_permissions, f_procedure_template, f_procedure_reminder_auto, f_api, f_checkdocument, f_procedure_create, f_signature_ui, f_server_stamp, f_operation_level_none, f_consent_process, f_operation_level_advanced, f_operation_custom_mode_email, f_dynamic_fields, saml_identity_provider, password_policy_pattern, password_policy_description, user_activation, f_procedure_template_permissions].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?.+?), (?.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = YousignClient.const_get(type).new temp_model.build_from_hash(value) end end # Returns the string representation of the object # @return [String] String presentation of the object def to_s to_hash.to_s end # to_body is an alias to to_hash (backward compatibility) # @return [Hash] Returns the object in the form of hash def to_body to_hash end # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end # Outputs non-array value in the form of hash # For object, use to_hash. Otherwise, just return the value # @param [Object] value Any valid value # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end end end