lib/cloudsmith-api/models/ruby_upstream.rb in cloudsmith-api-2.0.13 vs lib/cloudsmith-api/models/ruby_upstream.rb in cloudsmith-api-2.0.14

- old
+ new

@@ -24,10 +24,12 @@ attr_accessor :auth_username # The datetime the upstream source was created. attr_accessor :created_at + attr_accessor :disable_reason + # The key for extra header #1 to send to upstream. attr_accessor :extra_header_1 # The key for extra header #2 to send to upstream. attr_accessor :extra_header_2 @@ -45,10 +47,13 @@ attr_accessor :mode # A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. attr_accessor :name + # When true, this upstream source is pending validation. + attr_accessor :pending_validation + # Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. attr_accessor :priority attr_accessor :slug_perm @@ -87,17 +92,19 @@ { :'auth_mode' => :'auth_mode', :'auth_secret' => :'auth_secret', :'auth_username' => :'auth_username', :'created_at' => :'created_at', + :'disable_reason' => :'disable_reason', :'extra_header_1' => :'extra_header_1', :'extra_header_2' => :'extra_header_2', :'extra_value_1' => :'extra_value_1', :'extra_value_2' => :'extra_value_2', :'is_active' => :'is_active', :'mode' => :'mode', :'name' => :'name', + :'pending_validation' => :'pending_validation', :'priority' => :'priority', :'slug_perm' => :'slug_perm', :'updated_at' => :'updated_at', :'upstream_url' => :'upstream_url', :'verify_ssl' => :'verify_ssl' @@ -109,17 +116,19 @@ { :'auth_mode' => :'String', :'auth_secret' => :'String', :'auth_username' => :'String', :'created_at' => :'DateTime', + :'disable_reason' => :'String', :'extra_header_1' => :'String', :'extra_header_2' => :'String', :'extra_value_1' => :'String', :'extra_value_2' => :'String', :'is_active' => :'BOOLEAN', :'mode' => :'String', :'name' => :'String', + :'pending_validation' => :'BOOLEAN', :'priority' => :'Integer', :'slug_perm' => :'String', :'updated_at' => :'DateTime', :'upstream_url' => :'String', :'verify_ssl' => :'BOOLEAN' @@ -150,10 +159,16 @@ if attributes.has_key?(:'created_at') self.created_at = attributes[:'created_at'] end + if attributes.has_key?(:'disable_reason') + self.disable_reason = attributes[:'disable_reason'] + else + self.disable_reason = 'N/A' + end + if attributes.has_key?(:'extra_header_1') self.extra_header_1 = attributes[:'extra_header_1'] end if attributes.has_key?(:'extra_header_2') @@ -180,10 +195,14 @@ if attributes.has_key?(:'name') self.name = attributes[:'name'] end + if attributes.has_key?(:'pending_validation') + self.pending_validation = attributes[:'pending_validation'] + end + if attributes.has_key?(:'priority') self.priority = attributes[:'priority'] end if attributes.has_key?(:'slug_perm') @@ -221,10 +240,12 @@ # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? auth_mode_validator = EnumAttributeValidator.new('String', ['None', 'Username and Password']) return false unless auth_mode_validator.valid?(@auth_mode) + disable_reason_validator = EnumAttributeValidator.new('String', ['N/A', 'Upstream points to its own repository', 'Missing upstream source']) + return false unless disable_reason_validator.valid?(@disable_reason) mode_validator = EnumAttributeValidator.new('String', ['Proxy Only', 'Cache and Proxy']) return false unless mode_validator.valid?(@mode) return false if @name.nil? return false if @upstream_url.nil? true @@ -239,10 +260,20 @@ end @auth_mode = auth_mode end # Custom attribute writer method checking allowed values (enum). + # @param [Object] disable_reason Object to be assigned + def disable_reason=(disable_reason) + validator = EnumAttributeValidator.new('String', ['N/A', 'Upstream points to its own repository', 'Missing upstream source']) + unless validator.valid?(disable_reason) + fail ArgumentError, 'invalid value for "disable_reason", must be one of #{validator.allowable_values}.' + end + @disable_reason = disable_reason + end + + # Custom attribute writer method checking allowed values (enum). # @param [Object] mode Object to be assigned def mode=(mode) validator = EnumAttributeValidator.new('String', ['Proxy Only', 'Cache and Proxy']) unless validator.valid?(mode) fail ArgumentError, 'invalid value for "mode", must be one of #{validator.allowable_values}.' @@ -257,17 +288,19 @@ self.class == o.class && auth_mode == o.auth_mode && auth_secret == o.auth_secret && auth_username == o.auth_username && created_at == o.created_at && + disable_reason == o.disable_reason && extra_header_1 == o.extra_header_1 && extra_header_2 == o.extra_header_2 && extra_value_1 == o.extra_value_1 && extra_value_2 == o.extra_value_2 && is_active == o.is_active && mode == o.mode && name == o.name && + pending_validation == o.pending_validation && priority == o.priority && slug_perm == o.slug_perm && updated_at == o.updated_at && upstream_url == o.upstream_url && verify_ssl == o.verify_ssl @@ -280,10 +313,10 @@ end # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [auth_mode, auth_secret, auth_username, created_at, extra_header_1, extra_header_2, extra_value_1, extra_value_2, is_active, mode, name, priority, slug_perm, updated_at, upstream_url, verify_ssl].hash + [auth_mode, auth_secret, auth_username, created_at, disable_reason, extra_header_1, extra_header_2, extra_value_1, extra_value_2, is_active, mode, name, pending_validation, priority, slug_perm, updated_at, upstream_url, verify_ssl].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself