# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::CDN::Mgmt::V2020_04_15
  module Models
    #
    # Define match conditions
    #
    class MatchCondition

      include MsRestAzure

      # @return [MatchVariable] Match variable to compare against. Possible
      # values include: 'RemoteAddr', 'SocketAddr', 'RequestMethod',
      # 'RequestHeader', 'RequestUri', 'QueryString', 'RequestBody', 'Cookies',
      # 'PostArgs'
      attr_accessor :match_variable

      # @return [String] Selector can used to match a specific key for
      # QueryString, Cookies, RequestHeader or PostArgs.
      attr_accessor :selector

      # @return [Operator] Describes operator to be matched. Possible values
      # include: 'Any', 'IPMatch', 'GeoMatch', 'Equal', 'Contains', 'LessThan',
      # 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', 'BeginsWith',
      # 'EndsWith', 'RegEx'
      attr_accessor :operator

      # @return [Boolean] Describes if the result of this condition should be
      # negated.
      attr_accessor :negate_condition

      # @return [Array<String>] List of possible match values.
      attr_accessor :match_value

      # @return [Array<TransformType>] List of transforms.
      attr_accessor :transforms


      #
      # Mapper for MatchCondition class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'MatchCondition',
          type: {
            name: 'Composite',
            class_name: 'MatchCondition',
            model_properties: {
              match_variable: {
                client_side_validation: true,
                required: true,
                serialized_name: 'matchVariable',
                type: {
                  name: 'String'
                }
              },
              selector: {
                client_side_validation: true,
                required: false,
                serialized_name: 'selector',
                type: {
                  name: 'String'
                }
              },
              operator: {
                client_side_validation: true,
                required: true,
                serialized_name: 'operator',
                type: {
                  name: 'String'
                }
              },
              negate_condition: {
                client_side_validation: true,
                required: false,
                serialized_name: 'negateCondition',
                type: {
                  name: 'Boolean'
                }
              },
              match_value: {
                client_side_validation: true,
                required: true,
                serialized_name: 'matchValue',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'StringElementType',
                      type: {
                        name: 'String'
                      }
                  }
                }
              },
              transforms: {
                client_side_validation: true,
                required: false,
                serialized_name: 'transforms',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'TransformTypeElementType',
                      type: {
                        name: 'String'
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end
