class OpenapiClient::ConnectCarrierRequestBody
Attributes
Seko Account Access Key
Account
Account country code
Account number
Account postal code
Activation key
Address
Line 1
Address
Line 2
Boolean signaling agreement to the Fedex End User License Agreement
The Agreement to the [UPS Technology Agreement](www.ups.com/assets/resources/media/UTA_with_EUR.pdf)
API key
The DHL E-Commerce API secret. This field is optional, but if not set you will not be able to get rates for this account.
City
The client id
Company
Company name
Contact name
Canada Post Account Contract ID
Country code
The distribution center
The email address
First name
FTP password
FTP username
Induction site
The UPS invoice
Last name
Mailer id
Merchant id
Meter number
Nickname
The oba email address
Passphrase
Password
Phone
The pickup number
Postal code
Profile name
A string that uniquely identifies the sendle
A string that uniquely identifies the site
State
Street line1
Street line2
Street line3
Title
Username
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 162 def self.attribute_map { :'nickname' => :'nickname', :'username' => :'username', :'password' => :'password', :'merchant_seller_id' => :'merchant_seller_id', :'mws_auth_token' => :'mws_auth_token', :'email' => :'email', :'account_number' => :'account_number', :'ftp_username' => :'ftp_username', :'ftp_password' => :'ftp_password', :'api_key' => :'api_key', :'api_secret' => :'api_secret', :'contract_id' => :'contract_id', :'client_id' => :'client_id', :'pickup_number' => :'pickup_number', :'distribution_center' => :'distribution_center', :'ancillary_endorsement' => :'ancillary_endorsement', :'site_id' => :'site_id', :'account' => :'account', :'passphrase' => :'passphrase', :'address1' => :'address1', :'address2' => :'address2', :'city' => :'city', :'company' => :'company', :'country_code' => :'country_code', :'first_name' => :'first_name', :'last_name' => :'last_name', :'phone' => :'phone', :'postal_code' => :'postal_code', :'state' => :'state', :'agree_to_eula' => :'agree_to_eula', :'meter_number' => :'meter_number', :'mailer_id' => :'mailer_id', :'profile_name' => :'profile_name', :'merchant_id' => :'merchant_id', :'induction_site' => :'induction_site', :'activation_key' => :'activation_key', :'oba_email' => :'oba_email', :'contact_name' => :'contact_name', :'company_name' => :'company_name', :'street_line1' => :'street_line1', :'street_line2' => :'street_line2', :'street_line3' => :'street_line3', :'access_key' => :'access_key', :'sendle_id' => :'sendle_id', :'account_country_code' => :'account_country_code', :'account_postal_code' => :'account_postal_code', :'title' => :'title', :'invoice' => :'invoice', :'agree_to_technology_agreement' => :'agree_to_technology_agreement' } end
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1550 def self.build_from_hash(attributes) new.build_from_hash(attributes) end
Initializes the object @param [Hash] attributes Model attributes in the form of hash
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 312 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::ConnectCarrierRequestBody` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::ConnectCarrierRequestBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'nickname') self.nickname = attributes[:'nickname'] end if attributes.key?(:'username') self.username = attributes[:'username'] end if attributes.key?(:'password') self.password = attributes[:'password'] end if attributes.key?(:'merchant_seller_id') self.merchant_seller_id = attributes[:'merchant_seller_id'] end if attributes.key?(:'mws_auth_token') self.mws_auth_token = attributes[:'mws_auth_token'] end if attributes.key?(:'email') self.email = attributes[:'email'] end if attributes.key?(:'account_number') self.account_number = attributes[:'account_number'] end if attributes.key?(:'ftp_username') self.ftp_username = attributes[:'ftp_username'] end if attributes.key?(:'ftp_password') self.ftp_password = attributes[:'ftp_password'] end if attributes.key?(:'api_key') self.api_key = attributes[:'api_key'] end if attributes.key?(:'api_secret') self.api_secret = attributes[:'api_secret'] end if attributes.key?(:'contract_id') self.contract_id = attributes[:'contract_id'] end if attributes.key?(:'client_id') self.client_id = attributes[:'client_id'] end if attributes.key?(:'pickup_number') self.pickup_number = attributes[:'pickup_number'] end if attributes.key?(:'distribution_center') self.distribution_center = attributes[:'distribution_center'] end if attributes.key?(:'ancillary_endorsement') self.ancillary_endorsement = attributes[:'ancillary_endorsement'] end if attributes.key?(:'site_id') self.site_id = attributes[:'site_id'] end if attributes.key?(:'account') self.account = attributes[:'account'] end if attributes.key?(:'passphrase') self.passphrase = attributes[:'passphrase'] end if attributes.key?(:'address1') self.address1 = attributes[:'address1'] end if attributes.key?(:'address2') self.address2 = attributes[:'address2'] end if attributes.key?(:'city') self.city = attributes[:'city'] end if attributes.key?(:'company') self.company = attributes[:'company'] end if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] end if attributes.key?(:'first_name') self.first_name = attributes[:'first_name'] end if attributes.key?(:'last_name') self.last_name = attributes[:'last_name'] end if attributes.key?(:'phone') self.phone = attributes[:'phone'] end if attributes.key?(:'postal_code') self.postal_code = attributes[:'postal_code'] end if attributes.key?(:'state') self.state = attributes[:'state'] end if attributes.key?(:'agree_to_eula') self.agree_to_eula = attributes[:'agree_to_eula'] end if attributes.key?(:'meter_number') self.meter_number = attributes[:'meter_number'] end if attributes.key?(:'mailer_id') self.mailer_id = attributes[:'mailer_id'] end if attributes.key?(:'profile_name') self.profile_name = attributes[:'profile_name'] end if attributes.key?(:'merchant_id') self.merchant_id = attributes[:'merchant_id'] end if attributes.key?(:'induction_site') self.induction_site = attributes[:'induction_site'] end if attributes.key?(:'activation_key') self.activation_key = attributes[:'activation_key'] end if attributes.key?(:'oba_email') self.oba_email = attributes[:'oba_email'] end if attributes.key?(:'contact_name') self.contact_name = attributes[:'contact_name'] end if attributes.key?(:'company_name') self.company_name = attributes[:'company_name'] end if attributes.key?(:'street_line1') self.street_line1 = attributes[:'street_line1'] end if attributes.key?(:'street_line2') self.street_line2 = attributes[:'street_line2'] end if attributes.key?(:'street_line3') self.street_line3 = attributes[:'street_line3'] end if attributes.key?(:'access_key') self.access_key = attributes[:'access_key'] end if attributes.key?(:'sendle_id') self.sendle_id = attributes[:'sendle_id'] end if attributes.key?(:'account_country_code') self.account_country_code = attributes[:'account_country_code'] end if attributes.key?(:'account_postal_code') self.account_postal_code = attributes[:'account_postal_code'] end if attributes.key?(:'title') self.title = attributes[:'title'] end if attributes.key?(:'invoice') self.invoice = attributes[:'invoice'] end if attributes.key?(:'agree_to_technology_agreement') self.agree_to_technology_agreement = attributes[:'agree_to_technology_agreement'] end end
List of attributes with nullable: true
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 272 def self.openapi_nullable Set.new([ ]) end
List of class defined in oneOf (OpenAPI v3)
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 278 def self.openapi_one_of [ :'ConnectAccessWorldwideRequestBody', :'ConnectAmazonBuyShippingRequestBody', :'ConnectApcRequestBody', :'ConnectAsendiaRequestBody', :'ConnectAustraliaPostRequestBody', :'ConnectCanadaPostRequestBody', :'ConnectDhlEcommerceRequestBody', :'ConnectDhlExpressAuRequestBody', :'ConnectDhlExpressCaRequestBody', :'ConnectDhlExpressRequestBody', :'ConnectDhlExpressUkRequestBody', :'ConnectDpdRequestBody', :'ConnectEndiciaRequestBody', :'ConnectFedexRequestBody', :'ConnectFedexUkRequestBody', :'ConnectFirstmileRequestBody', :'ConnectGlobegisticsRequestBody', :'ConnectImexRequestBody', :'ConnectNewgisticsRequestBody', :'ConnectOntracRequestBody', :'ConnectPurolatorRequestBody', :'ConnectRoyalMailRequestBody', :'ConnectRrDonnelleyRequestBody', :'ConnectSekoRequestBody', :'ConnectSendleRequestBody', :'ConnectStampsRequestBody', :'ConnectUpsRequestBody' ] end
Attribute type mapping.
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 217 def self.openapi_types { :'nickname' => :'String', :'username' => :'String', :'password' => :'String', :'merchant_seller_id' => :'String', :'mws_auth_token' => :'String', :'email' => :'String', :'account_number' => :'String', :'ftp_username' => :'String', :'ftp_password' => :'String', :'api_key' => :'String', :'api_secret' => :'String', :'contract_id' => :'String', :'client_id' => :'String', :'pickup_number' => :'String', :'distribution_center' => :'String', :'ancillary_endorsement' => :'AncillaryServiceEndorsement', :'site_id' => :'String', :'account' => :'String', :'passphrase' => :'String', :'address1' => :'String', :'address2' => :'String', :'city' => :'String', :'company' => :'String', :'country_code' => :'String', :'first_name' => :'String', :'last_name' => :'String', :'phone' => :'String', :'postal_code' => :'String', :'state' => :'String', :'agree_to_eula' => :'Boolean', :'meter_number' => :'String', :'mailer_id' => :'Integer', :'profile_name' => :'String', :'merchant_id' => :'Integer', :'induction_site' => :'String', :'activation_key' => :'String', :'oba_email' => :'String', :'contact_name' => :'String', :'company_name' => :'String', :'street_line1' => :'String', :'street_line2' => :'String', :'street_line3' => :'String', :'access_key' => :'String', :'sendle_id' => :'String', :'account_country_code' => :'String', :'account_postal_code' => :'String', :'title' => :'String', :'invoice' => :'UpsInvoice', :'agree_to_technology_agreement' => :'Boolean' } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] Object to be compared
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1481 def ==(o) return true if self.equal?(o) self.class == o.class && nickname == o.nickname && username == o.username && password == o.password && merchant_seller_id == o.merchant_seller_id && mws_auth_token == o.mws_auth_token && email == o.email && account_number == o.account_number && ftp_username == o.ftp_username && ftp_password == o.ftp_password && api_key == o.api_key && api_secret == o.api_secret && contract_id == o.contract_id && client_id == o.client_id && pickup_number == o.pickup_number && distribution_center == o.distribution_center && ancillary_endorsement == o.ancillary_endorsement && site_id == o.site_id && account == o.account && passphrase == o.passphrase && address1 == o.address1 && address2 == o.address2 && city == o.city && company == o.company && country_code == o.country_code && first_name == o.first_name && last_name == o.last_name && phone == o.phone && postal_code == o.postal_code && state == o.state && agree_to_eula == o.agree_to_eula && meter_number == o.meter_number && mailer_id == o.mailer_id && profile_name == o.profile_name && merchant_id == o.merchant_id && induction_site == o.induction_site && activation_key == o.activation_key && oba_email == o.oba_email && contact_name == o.contact_name && company_name == o.company_name && street_line1 == o.street_line1 && street_line2 == o.street_line2 && street_line3 == o.street_line3 && access_key == o.access_key && sendle_id == o.sendle_id && account_country_code == o.account_country_code && account_postal_code == o.account_postal_code && title == o.title && invoice == o.invoice && agree_to_technology_agreement == o.agree_to_technology_agreement end
Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1578 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<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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 OpenapiClient.const_get(type).build_from_hash(value) end 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
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1647 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
Custom attribute writer method with validation @param [Object] access_key
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1429 def access_key=(access_key) if access_key.nil? fail ArgumentError, 'access_key cannot be nil' end if access_key.to_s.length < 1 fail ArgumentError, 'invalid value for "access_key", the character length must be great than or equal to 1.' end @access_key = access_key end
Custom attribute writer method with validation @param [Object] account Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1139 def account=(account) if account.nil? fail ArgumentError, 'account cannot be nil' end if account.to_s.length < 1 fail ArgumentError, 'invalid value for "account", the character length must be great than or equal to 1.' end @account = account end
Custom attribute writer method with validation @param [Object] account_country_code
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1443 def account_country_code=(account_country_code) if account_country_code.nil? fail ArgumentError, 'account_country_code cannot be nil' end if account_country_code.to_s.length < 1 fail ArgumentError, 'invalid value for "account_country_code", the character length must be great than or equal to 1.' end @account_country_code = account_country_code end
Custom attribute writer method with validation @param [Object] account_number
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1013 def account_number=(account_number) if account_number.nil? fail ArgumentError, 'account_number cannot be nil' end if account_number.to_s.length < 1 fail ArgumentError, 'invalid value for "account_number", the character length must be great than or equal to 1.' end @account_number = account_number end
Custom attribute writer method with validation @param [Object] account_postal_code
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1457 def account_postal_code=(account_postal_code) if account_postal_code.nil? fail ArgumentError, 'account_postal_code cannot be nil' end if account_postal_code.to_s.length < 1 fail ArgumentError, 'invalid value for "account_postal_code", the character length must be great than or equal to 1.' end @account_postal_code = account_postal_code end
Custom attribute writer method with validation @param [Object] activation_key
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1361 def activation_key=(activation_key) if activation_key.nil? fail ArgumentError, 'activation_key cannot be nil' end if activation_key.to_s.length < 1 fail ArgumentError, 'invalid value for "activation_key", the character length must be great than or equal to 1.' end @activation_key = activation_key end
Custom attribute writer method with validation @param [Object] address1 Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1167 def address1=(address1) if address1.nil? fail ArgumentError, 'address1 cannot be nil' end if address1.to_s.length < 1 fail ArgumentError, 'invalid value for "address1", the character length must be great than or equal to 1.' end @address1 = address1 end
Custom attribute writer method with validation @param [Object] address2 Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1181 def address2=(address2) if !address2.nil? && address2.to_s.length < 1 fail ArgumentError, 'invalid value for "address2", the character length must be great than or equal to 1.' end @address2 = address2 end
Custom attribute writer method with validation @param [Object] api_key
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1055 def api_key=(api_key) if api_key.nil? fail ArgumentError, 'api_key cannot be nil' end if api_key.to_s.length < 1 fail ArgumentError, 'invalid value for "api_key", the character length must be great than or equal to 1.' end @api_key = api_key end
Custom attribute writer method with validation @param [Object] api_secret
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1069 def api_secret=(api_secret) if api_secret.nil? fail ArgumentError, 'api_secret cannot be nil' end if api_secret.to_s.length < 1 fail ArgumentError, 'invalid value for "api_secret", the character length must be great than or equal to 1.' end @api_secret = api_secret end
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1557 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_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
Custom attribute writer method with validation @param [Object] city Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1191 def city=(city) if city.nil? fail ArgumentError, 'city cannot be nil' end if city.to_s.length < 1 fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' end @city = city end
Custom attribute writer method with validation @param [Object] client_id
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1097 def client_id=(client_id) if client_id.nil? fail ArgumentError, 'client_id cannot be nil' end if client_id.to_s.length < 1 fail ArgumentError, 'invalid value for "client_id", the character length must be great than or equal to 1.' end @client_id = client_id end
Custom attribute writer method with validation @param [Object] company Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1205 def company=(company) if company.nil? fail ArgumentError, 'company cannot be nil' end if company.to_s.length < 1 fail ArgumentError, 'invalid value for "company", the character length must be great than or equal to 1.' end @company = company end
Custom attribute writer method with validation @param [Object] company_name
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1389 def company_name=(company_name) if !company_name.nil? && company_name.to_s.length < 1 fail ArgumentError, 'invalid value for "company_name", the character length must be great than or equal to 1.' end @company_name = company_name end
Custom attribute writer method with validation @param [Object] contact_name
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1375 def contact_name=(contact_name) if contact_name.nil? fail ArgumentError, 'contact_name cannot be nil' end if contact_name.to_s.length < 1 fail ArgumentError, 'invalid value for "contact_name", the character length must be great than or equal to 1.' end @contact_name = contact_name end
Custom attribute writer method with validation @param [Object] contract_id
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1083 def contract_id=(contract_id) if contract_id.nil? fail ArgumentError, 'contract_id cannot be nil' end if contract_id.to_s.length < 1 fail ArgumentError, 'invalid value for "contract_id", the character length must be great than or equal to 1.' end @contract_id = contract_id end
Custom attribute writer method with validation @param [Object] country_code
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1219 def country_code=(country_code) if country_code.nil? fail ArgumentError, 'country_code cannot be nil' end if country_code.to_s.length < 1 fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' end @country_code = country_code end
Custom attribute writer method with validation @param [Object] distribution_center
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1125 def distribution_center=(distribution_center) if distribution_center.nil? fail ArgumentError, 'distribution_center cannot be nil' end if distribution_center.to_s.length < 1 fail ArgumentError, 'invalid value for "distribution_center", the character length must be great than or equal to 1.' end @distribution_center = distribution_center end
@see the `==` method @param [Object] Object to be compared
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1537 def eql?(o) self == o end
Custom attribute writer method with validation @param [Object] first_name
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1233 def first_name=(first_name) if first_name.nil? fail ArgumentError, 'first_name cannot be nil' end if first_name.to_s.length < 1 fail ArgumentError, 'invalid value for "first_name", the character length must be great than or equal to 1.' end @first_name = first_name end
Custom attribute writer method with validation @param [Object] ftp_password
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1041 def ftp_password=(ftp_password) if ftp_password.nil? fail ArgumentError, 'ftp_password cannot be nil' end if ftp_password.to_s.length < 1 fail ArgumentError, 'invalid value for "ftp_password", the character length must be great than or equal to 1.' end @ftp_password = ftp_password end
Custom attribute writer method with validation @param [Object] ftp_username
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1027 def ftp_username=(ftp_username) if ftp_username.nil? fail ArgumentError, 'ftp_username cannot be nil' end if ftp_username.to_s.length < 1 fail ArgumentError, 'invalid value for "ftp_username", the character length must be great than or equal to 1.' end @ftp_username = ftp_username end
Calculates hash code according to all attributes. @return [Integer] Hash code
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1543 def hash [nickname, username, password, merchant_seller_id, mws_auth_token, email, account_number, ftp_username, ftp_password, api_key, api_secret, contract_id, client_id, pickup_number, distribution_center, ancillary_endorsement, site_id, account, passphrase, address1, address2, city, company, country_code, first_name, last_name, phone, postal_code, state, agree_to_eula, meter_number, mailer_id, profile_name, merchant_id, induction_site, activation_key, oba_email, contact_name, company_name, street_line1, street_line2, street_line3, access_key, sendle_id, account_country_code, account_postal_code, title, invoice, agree_to_technology_agreement].hash end
Custom attribute writer method with validation @param [Object] induction_site
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1347 def induction_site=(induction_site) if induction_site.nil? fail ArgumentError, 'induction_site cannot be nil' end if induction_site.to_s.length < 1 fail ArgumentError, 'invalid value for "induction_site", the character length must be great than or equal to 1.' end @induction_site = induction_site end
Custom attribute writer method with validation @param [Object] last_name
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1247 def last_name=(last_name) if last_name.nil? fail ArgumentError, 'last_name cannot be nil' end if last_name.to_s.length < 1 fail ArgumentError, 'invalid value for "last_name", the character length must be great than or equal to 1.' end @last_name = last_name end
Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 524 def list_invalid_properties invalid_properties = Array.new if @nickname.nil? invalid_properties.push('invalid value for "nickname", nickname cannot be nil.') end if @nickname.to_s.length < 1 invalid_properties.push('invalid value for "nickname", the character length must be great than or equal to 1.') end if @username.nil? invalid_properties.push('invalid value for "username", username cannot be nil.') end if @username.to_s.length < 1 invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.') end if @password.nil? invalid_properties.push('invalid value for "password", password cannot be nil.') end if @password.to_s.length < 1 invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.') end if @merchant_seller_id.nil? invalid_properties.push('invalid value for "merchant_seller_id", merchant_seller_id cannot be nil.') end if @merchant_seller_id.to_s.length < 1 invalid_properties.push('invalid value for "merchant_seller_id", the character length must be great than or equal to 1.') end if @mws_auth_token.nil? invalid_properties.push('invalid value for "mws_auth_token", mws_auth_token cannot be nil.') end if @mws_auth_token.to_s.length < 1 invalid_properties.push('invalid value for "mws_auth_token", the character length must be great than or equal to 1.') end if @email.nil? invalid_properties.push('invalid value for "email", email cannot be nil.') end if @account_number.nil? invalid_properties.push('invalid value for "account_number", account_number cannot be nil.') end if @account_number.to_s.length < 1 invalid_properties.push('invalid value for "account_number", the character length must be great than or equal to 1.') end if @ftp_username.nil? invalid_properties.push('invalid value for "ftp_username", ftp_username cannot be nil.') end if @ftp_username.to_s.length < 1 invalid_properties.push('invalid value for "ftp_username", the character length must be great than or equal to 1.') end if @ftp_password.nil? invalid_properties.push('invalid value for "ftp_password", ftp_password cannot be nil.') end if @ftp_password.to_s.length < 1 invalid_properties.push('invalid value for "ftp_password", the character length must be great than or equal to 1.') end if @api_key.nil? invalid_properties.push('invalid value for "api_key", api_key cannot be nil.') end if @api_key.to_s.length < 1 invalid_properties.push('invalid value for "api_key", the character length must be great than or equal to 1.') end if @api_secret.nil? invalid_properties.push('invalid value for "api_secret", api_secret cannot be nil.') end if @api_secret.to_s.length < 1 invalid_properties.push('invalid value for "api_secret", the character length must be great than or equal to 1.') end if @contract_id.nil? invalid_properties.push('invalid value for "contract_id", contract_id cannot be nil.') end if @contract_id.to_s.length < 1 invalid_properties.push('invalid value for "contract_id", the character length must be great than or equal to 1.') end if @client_id.nil? invalid_properties.push('invalid value for "client_id", client_id cannot be nil.') end if @client_id.to_s.length < 1 invalid_properties.push('invalid value for "client_id", the character length must be great than or equal to 1.') end if @pickup_number.nil? invalid_properties.push('invalid value for "pickup_number", pickup_number cannot be nil.') end if @pickup_number.to_s.length < 1 invalid_properties.push('invalid value for "pickup_number", the character length must be great than or equal to 1.') end if @distribution_center.nil? invalid_properties.push('invalid value for "distribution_center", distribution_center cannot be nil.') end if @distribution_center.to_s.length < 1 invalid_properties.push('invalid value for "distribution_center", the character length must be great than or equal to 1.') end if @site_id.nil? invalid_properties.push('invalid value for "site_id", site_id cannot be nil.') end if @account.nil? invalid_properties.push('invalid value for "account", account cannot be nil.') end if @account.to_s.length < 1 invalid_properties.push('invalid value for "account", the character length must be great than or equal to 1.') end if @passphrase.nil? invalid_properties.push('invalid value for "passphrase", passphrase cannot be nil.') end if @passphrase.to_s.length < 1 invalid_properties.push('invalid value for "passphrase", the character length must be great than or equal to 1.') end if @address1.nil? invalid_properties.push('invalid value for "address1", address1 cannot be nil.') end if @address1.to_s.length < 1 invalid_properties.push('invalid value for "address1", the character length must be great than or equal to 1.') end if !@address2.nil? && @address2.to_s.length < 1 invalid_properties.push('invalid value for "address2", the character length must be great than or equal to 1.') end if @city.nil? invalid_properties.push('invalid value for "city", city cannot be nil.') end if @city.to_s.length < 1 invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') end if @company.nil? invalid_properties.push('invalid value for "company", company cannot be nil.') end if @company.to_s.length < 1 invalid_properties.push('invalid value for "company", the character length must be great than or equal to 1.') end if @country_code.nil? invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') end if @country_code.to_s.length < 1 invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') end if @first_name.nil? invalid_properties.push('invalid value for "first_name", first_name cannot be nil.') end if @first_name.to_s.length < 1 invalid_properties.push('invalid value for "first_name", the character length must be great than or equal to 1.') end if @last_name.nil? invalid_properties.push('invalid value for "last_name", last_name cannot be nil.') end if @last_name.to_s.length < 1 invalid_properties.push('invalid value for "last_name", the character length must be great than or equal to 1.') end if @phone.nil? invalid_properties.push('invalid value for "phone", phone cannot be nil.') end if @phone.to_s.length < 1 invalid_properties.push('invalid value for "phone", the character length must be great than or equal to 1.') end if @postal_code.nil? invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.') end if @postal_code.to_s.length < 1 invalid_properties.push('invalid value for "postal_code", the character length must be great than or equal to 1.') end if @state.nil? invalid_properties.push('invalid value for "state", state cannot be nil.') end if @state.to_s.length < 1 invalid_properties.push('invalid value for "state", the character length must be great than or equal to 1.') end if @agree_to_eula.nil? invalid_properties.push('invalid value for "agree_to_eula", agree_to_eula cannot be nil.') end if !@meter_number.nil? && @meter_number.to_s.length < 1 invalid_properties.push('invalid value for "meter_number", the character length must be great than or equal to 1.') end if @mailer_id.nil? invalid_properties.push('invalid value for "mailer_id", mailer_id cannot be nil.') end if @mailer_id < 0 invalid_properties.push('invalid value for "mailer_id", must be greater than or equal to 0.') end if !@profile_name.nil? && @profile_name.to_s.length < 1 invalid_properties.push('invalid value for "profile_name", the character length must be great than or equal to 1.') end if !@merchant_id.nil? && @merchant_id < 0 invalid_properties.push('invalid value for "merchant_id", must be greater than or equal to 0.') end if @induction_site.nil? invalid_properties.push('invalid value for "induction_site", induction_site cannot be nil.') end if @induction_site.to_s.length < 1 invalid_properties.push('invalid value for "induction_site", the character length must be great than or equal to 1.') end if @activation_key.nil? invalid_properties.push('invalid value for "activation_key", activation_key cannot be nil.') end if @activation_key.to_s.length < 1 invalid_properties.push('invalid value for "activation_key", the character length must be great than or equal to 1.') end if @contact_name.nil? invalid_properties.push('invalid value for "contact_name", contact_name cannot be nil.') end if @contact_name.to_s.length < 1 invalid_properties.push('invalid value for "contact_name", the character length must be great than or equal to 1.') end if !@company_name.nil? && @company_name.to_s.length < 1 invalid_properties.push('invalid value for "company_name", the character length must be great than or equal to 1.') end if !@street_line1.nil? && @street_line1.to_s.length < 1 invalid_properties.push('invalid value for "street_line1", the character length must be great than or equal to 1.') end if !@street_line2.nil? && @street_line2.to_s.length < 1 invalid_properties.push('invalid value for "street_line2", the character length must be great than or equal to 1.') end if !@street_line3.nil? && @street_line3.to_s.length < 1 invalid_properties.push('invalid value for "street_line3", the character length must be great than or equal to 1.') end if @access_key.nil? invalid_properties.push('invalid value for "access_key", access_key cannot be nil.') end if @access_key.to_s.length < 1 invalid_properties.push('invalid value for "access_key", the character length must be great than or equal to 1.') end if @sendle_id.nil? invalid_properties.push('invalid value for "sendle_id", sendle_id cannot be nil.') end if @account_country_code.nil? invalid_properties.push('invalid value for "account_country_code", account_country_code cannot be nil.') end if @account_country_code.to_s.length < 1 invalid_properties.push('invalid value for "account_country_code", the character length must be great than or equal to 1.') end if @account_postal_code.nil? invalid_properties.push('invalid value for "account_postal_code", account_postal_code cannot be nil.') end if @account_postal_code.to_s.length < 1 invalid_properties.push('invalid value for "account_postal_code", the character length must be great than or equal to 1.') end if !@title.nil? && @title.to_s.length < 1 invalid_properties.push('invalid value for "title", the character length must be great than or equal to 1.') end if @agree_to_technology_agreement.nil? invalid_properties.push('invalid value for "agree_to_technology_agreement", agree_to_technology_agreement cannot be nil.') end invalid_properties end
Custom attribute writer method with validation @param [Object] mailer_id
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1313 def mailer_id=(mailer_id) if mailer_id.nil? fail ArgumentError, 'mailer_id cannot be nil' end if mailer_id < 0 fail ArgumentError, 'invalid value for "mailer_id", must be greater than or equal to 0.' end @mailer_id = mailer_id end
Custom attribute writer method with validation @param [Object] merchant_id
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1337 def merchant_id=(merchant_id) if !merchant_id.nil? && merchant_id < 0 fail ArgumentError, 'invalid value for "merchant_id", must be greater than or equal to 0.' end @merchant_id = merchant_id end
Custom attribute writer method with validation @param [Object] merchant_seller_id
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 985 def merchant_seller_id=(merchant_seller_id) if merchant_seller_id.nil? fail ArgumentError, 'merchant_seller_id cannot be nil' end if merchant_seller_id.to_s.length < 1 fail ArgumentError, 'invalid value for "merchant_seller_id", the character length must be great than or equal to 1.' end @merchant_seller_id = merchant_seller_id end
Custom attribute writer method with validation @param [Object] meter_number
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1303 def meter_number=(meter_number) if !meter_number.nil? && meter_number.to_s.length < 1 fail ArgumentError, 'invalid value for "meter_number", the character length must be great than or equal to 1.' end @meter_number = meter_number end
Custom attribute writer method with validation @param [Object] mws_auth_token
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 999 def mws_auth_token=(mws_auth_token) if mws_auth_token.nil? fail ArgumentError, 'mws_auth_token cannot be nil' end if mws_auth_token.to_s.length < 1 fail ArgumentError, 'invalid value for "mws_auth_token", the character length must be great than or equal to 1.' end @mws_auth_token = mws_auth_token end
Custom attribute writer method with validation @param [Object] nickname Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 943 def nickname=(nickname) if nickname.nil? fail ArgumentError, 'nickname cannot be nil' end if nickname.to_s.length < 1 fail ArgumentError, 'invalid value for "nickname", the character length must be great than or equal to 1.' end @nickname = nickname end
Custom attribute writer method with validation @param [Object] passphrase Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1153 def passphrase=(passphrase) if passphrase.nil? fail ArgumentError, 'passphrase cannot be nil' end if passphrase.to_s.length < 1 fail ArgumentError, 'invalid value for "passphrase", the character length must be great than or equal to 1.' end @passphrase = passphrase end
Custom attribute writer method with validation @param [Object] password Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 971 def password=(password) if password.nil? fail ArgumentError, 'password cannot be nil' end if password.to_s.length < 1 fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.' end @password = password end
Custom attribute writer method with validation @param [Object] phone Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1261 def phone=(phone) if phone.nil? fail ArgumentError, 'phone cannot be nil' end if phone.to_s.length < 1 fail ArgumentError, 'invalid value for "phone", the character length must be great than or equal to 1.' end @phone = phone end
Custom attribute writer method with validation @param [Object] pickup_number
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1111 def pickup_number=(pickup_number) if pickup_number.nil? fail ArgumentError, 'pickup_number cannot be nil' end if pickup_number.to_s.length < 1 fail ArgumentError, 'invalid value for "pickup_number", the character length must be great than or equal to 1.' end @pickup_number = pickup_number end
Custom attribute writer method with validation @param [Object] postal_code
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1275 def postal_code=(postal_code) if postal_code.nil? fail ArgumentError, 'postal_code cannot be nil' end if postal_code.to_s.length < 1 fail ArgumentError, 'invalid value for "postal_code", the character length must be great than or equal to 1.' end @postal_code = postal_code end
Custom attribute writer method with validation @param [Object] profile_name
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1327 def profile_name=(profile_name) if !profile_name.nil? && profile_name.to_s.length < 1 fail ArgumentError, 'invalid value for "profile_name", the character length must be great than or equal to 1.' end @profile_name = profile_name end
Custom attribute writer method with validation @param [Object] state Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1289 def state=(state) if state.nil? fail ArgumentError, 'state cannot be nil' end if state.to_s.length < 1 fail ArgumentError, 'invalid value for "state", the character length must be great than or equal to 1.' end @state = state end
Custom attribute writer method with validation @param [Object] street_line1
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1399 def street_line1=(street_line1) if !street_line1.nil? && street_line1.to_s.length < 1 fail ArgumentError, 'invalid value for "street_line1", the character length must be great than or equal to 1.' end @street_line1 = street_line1 end
Custom attribute writer method with validation @param [Object] street_line2
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1409 def street_line2=(street_line2) if !street_line2.nil? && street_line2.to_s.length < 1 fail ArgumentError, 'invalid value for "street_line2", the character length must be great than or equal to 1.' end @street_line2 = street_line2 end
Custom attribute writer method with validation @param [Object] street_line3
Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1419 def street_line3=(street_line3) if !street_line3.nil? && street_line3.to_s.length < 1 fail ArgumentError, 'invalid value for "street_line3", the character length must be great than or equal to 1.' end @street_line3 = street_line3 end
Custom attribute writer method with validation @param [Object] title Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1471 def title=(title) if !title.nil? && title.to_s.length < 1 fail ArgumentError, 'invalid value for "title", the character length must be great than or equal to 1.' end @title = title end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1629 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end
Returns the string representation of the object @return [String] String presentation of the object
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 1617 def to_s to_hash.to_s end
Custom attribute writer method with validation @param [Object] username Value to be assigned
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 957 def username=(username) if username.nil? fail ArgumentError, 'username cannot be nil' end if username.to_s.length < 1 fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.' end @username = username end
Check to see if the all the properties in the model are valid @return true if the model is valid
# File lib/openapi_client/models/connect_carrier_request_body.rb, line 843 def valid? return false if @nickname.nil? return false if @nickname.to_s.length < 1 return false if @username.nil? return false if @username.to_s.length < 1 return false if @password.nil? return false if @password.to_s.length < 1 return false if @merchant_seller_id.nil? return false if @merchant_seller_id.to_s.length < 1 return false if @mws_auth_token.nil? return false if @mws_auth_token.to_s.length < 1 return false if @email.nil? return false if @account_number.nil? return false if @account_number.to_s.length < 1 return false if @ftp_username.nil? return false if @ftp_username.to_s.length < 1 return false if @ftp_password.nil? return false if @ftp_password.to_s.length < 1 return false if @api_key.nil? return false if @api_key.to_s.length < 1 return false if @api_secret.nil? return false if @api_secret.to_s.length < 1 return false if @contract_id.nil? return false if @contract_id.to_s.length < 1 return false if @client_id.nil? return false if @client_id.to_s.length < 1 return false if @pickup_number.nil? return false if @pickup_number.to_s.length < 1 return false if @distribution_center.nil? return false if @distribution_center.to_s.length < 1 return false if @site_id.nil? return false if @account.nil? return false if @account.to_s.length < 1 return false if @passphrase.nil? return false if @passphrase.to_s.length < 1 return false if @address1.nil? return false if @address1.to_s.length < 1 return false if !@address2.nil? && @address2.to_s.length < 1 return false if @city.nil? return false if @city.to_s.length < 1 return false if @company.nil? return false if @company.to_s.length < 1 return false if @country_code.nil? return false if @country_code.to_s.length < 1 return false if @first_name.nil? return false if @first_name.to_s.length < 1 return false if @last_name.nil? return false if @last_name.to_s.length < 1 return false if @phone.nil? return false if @phone.to_s.length < 1 return false if @postal_code.nil? return false if @postal_code.to_s.length < 1 return false if @state.nil? return false if @state.to_s.length < 1 return false if @agree_to_eula.nil? return false if !@meter_number.nil? && @meter_number.to_s.length < 1 return false if @mailer_id.nil? return false if @mailer_id < 0 return false if !@profile_name.nil? && @profile_name.to_s.length < 1 return false if !@merchant_id.nil? && @merchant_id < 0 return false if @induction_site.nil? return false if @induction_site.to_s.length < 1 return false if @activation_key.nil? return false if @activation_key.to_s.length < 1 return false if @contact_name.nil? return false if @contact_name.to_s.length < 1 return false if !@company_name.nil? && @company_name.to_s.length < 1 return false if !@street_line1.nil? && @street_line1.to_s.length < 1 return false if !@street_line2.nil? && @street_line2.to_s.length < 1 return false if !@street_line3.nil? && @street_line3.to_s.length < 1 return false if @access_key.nil? return false if @access_key.to_s.length < 1 return false if @sendle_id.nil? return false if @account_country_code.nil? return false if @account_country_code.to_s.length < 1 return false if @account_postal_code.nil? return false if @account_postal_code.to_s.length < 1 return false if !@title.nil? && @title.to_s.length < 1 return false if @agree_to_technology_agreement.nil? _one_of_found = false self.class.openapi_one_of.each do |_class| _one_of = OpenapiClient.const_get(_class).build_from_hash(self.to_hash) if _one_of.valid? if _one_of_found return false else _one_of_found = true end end end if !_one_of_found return false end true end