lib/fastly/models/logging_kinesis_response.rb in fastly-4.0.0.alpha4 vs lib/fastly/models/logging_kinesis_response.rb in fastly-4.0.0
- old
+ new
@@ -24,11 +24,10 @@
attr_accessor :format
# The Amazon Kinesis stream to send logs to. Required.
attr_accessor :topic
- # The [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints) to stream logs to.
attr_accessor :region
# The secret key associated with the target Amazon Kinesis stream. Not required if `iam_role` is specified.
attr_accessor :secret_key
@@ -49,32 +48,10 @@
attr_accessor :service_id
attr_accessor :version
- class EnumAttributeValidator
- attr_reader :datatype
- attr_reader :allowable_values
-
- def initialize(datatype, allowable_values)
- @allowable_values = allowable_values.map do |value|
- case datatype.to_s
- when /Integer/i
- value.to_i
- when /Float/i
- value.to_f
- else
- value
- end
- end
- end
-
- def valid?(value)
- !value || allowable_values.include?(value)
- end
- end
-
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'name' => :'name',
:'placement' => :'placement',
@@ -104,11 +81,11 @@
:'name' => :'String',
:'placement' => :'LoggingPlacement',
:'format_version' => :'LoggingFormatVersion',
:'format' => :'String',
:'topic' => :'String',
- :'region' => :'String',
+ :'region' => :'AwsRegion',
:'secret_key' => :'String',
:'access_key' => :'String',
:'iam_role' => :'String',
:'created_at' => :'Time',
:'deleted_at' => :'Time',
@@ -126,12 +103,10 @@
:'access_key',
:'iam_role',
:'created_at',
:'deleted_at',
:'updated_at',
- :'service_id',
- :'version'
])
end
# List of class defined in allOf (OpenAPI v3)
def self.fastly_all_of
@@ -226,22 +201,10 @@
end
# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
- region_validator = EnumAttributeValidator.new('String', ["us-east-1", "us-east-2", "us-west-1", "us-west-2", "af-south-1", "ap-east-1", "ap-south-1", "ap-northeast-3", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ca-central-1", "cn-north-1", "cn-northwest-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-south-1", "eu-west-3", "eu-north-1", "me-south-1", "sa-east-1"])
- return false unless region_validator.valid?(@region)
true
- end
-
- # Custom attribute writer method checking allowed values (enum).
- # @param [Object] region Object to be assigned
- def region=(region)
- validator = EnumAttributeValidator.new('String', ["us-east-1", "us-east-2", "us-west-1", "us-west-2", "af-south-1", "ap-east-1", "ap-south-1", "ap-northeast-3", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ca-central-1", "cn-north-1", "cn-northwest-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-south-1", "eu-west-3", "eu-north-1", "me-south-1", "sa-east-1"])
- unless validator.valid?(region)
- fail ArgumentError, "invalid value for \"region\", must be one of #{validator.allowable_values}."
- end
- @region = region
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)