# 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_09_01
  module Models
    #
    # Defines the parameters for the url redirect action.
    #
    class UrlRedirectActionParameters

      include MsRestAzure

      # @return [String] . Default value:
      # '#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlRedirectActionParameters' .
      attr_accessor :odatatype

      # @return [RedirectType] The redirect type the rule will use when
      # redirecting traffic. Possible values include: 'Moved', 'Found',
      # 'TemporaryRedirect', 'PermanentRedirect'
      attr_accessor :redirect_type

      # @return [DestinationProtocol] Protocol to use for the redirect. The
      # default value is MatchRequest. Possible values include: 'MatchRequest',
      # 'Http', 'Https'
      attr_accessor :destination_protocol

      # @return [String] The full path to redirect. Path cannot be empty and
      # must start with /. Leave empty to use the incoming path as destination
      # path.
      attr_accessor :custom_path

      # @return [String] Host to redirect. Leave empty to use the incoming host
      # as the destination host.
      attr_accessor :custom_hostname

      # @return [String] The set of query strings to be placed in the redirect
      # URL. Setting this value would replace any existing query string; leave
      # empty to preserve the incoming query string. Query string must be in
      # <key>=<value> format. ? and & will be added automatically so do not
      # include them.
      attr_accessor :custom_query_string

      # @return [String] Fragment to add to the redirect URL. Fragment is the
      # part of the URL that comes after #. Do not include the #.
      attr_accessor :custom_fragment


      #
      # Mapper for UrlRedirectActionParameters class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'UrlRedirectActionParameters',
          type: {
            name: 'Composite',
            class_name: 'UrlRedirectActionParameters',
            model_properties: {
              odatatype: {
                client_side_validation: true,
                required: true,
                is_constant: true,
                serialized_name: '@odata\\.type',
                default_value: '#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlRedirectActionParameters',
                type: {
                  name: 'String'
                }
              },
              redirect_type: {
                client_side_validation: true,
                required: true,
                serialized_name: 'redirectType',
                type: {
                  name: 'String'
                }
              },
              destination_protocol: {
                client_side_validation: true,
                required: false,
                serialized_name: 'destinationProtocol',
                type: {
                  name: 'String'
                }
              },
              custom_path: {
                client_side_validation: true,
                required: false,
                serialized_name: 'customPath',
                type: {
                  name: 'String'
                }
              },
              custom_hostname: {
                client_side_validation: true,
                required: false,
                serialized_name: 'customHostname',
                type: {
                  name: 'String'
                }
              },
              custom_query_string: {
                client_side_validation: true,
                required: false,
                serialized_name: 'customQueryString',
                type: {
                  name: 'String'
                }
              },
              custom_fragment: {
                client_side_validation: true,
                required: false,
                serialized_name: 'customFragment',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end
