lib/fastly/models/logging_kinesis.rb in fastly-4.0.0.alpha4 vs lib/fastly/models/logging_kinesis.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 @@ -36,32 +35,10 @@ attr_accessor :access_key # The ARN for an IAM role granting Fastly access to the target Amazon Kinesis stream. Not required if `access_key` and `secret_key` are provided. attr_accessor :iam_role - 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', @@ -86,11 +63,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' } end @@ -169,22 +146,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)