# 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::ApiManagement::Mgmt::V2019_01_01
  module Models
    #
    # Subscription details.
    #
    class SubscriptionContract < Resource

      include MsRestAzure

      # @return [String] The user resource identifier of the subscription
      # owner. The value is a valid relative URL in the format of
      # /users/{userId} where {userId} is a user identifier.
      attr_accessor :owner_id

      # @return [String] Scope like /products/{productId} or /apis or
      # /apis/{apiId}.
      attr_accessor :scope

      # @return [String] The name of the subscription, or null if the
      # subscription has no name.
      attr_accessor :display_name

      # @return [SubscriptionState] Subscription state. Possible states are *
      # active – the subscription is active, * suspended – the subscription is
      # blocked, and the subscriber cannot call any APIs of the product, *
      # submitted – the subscription request has been made by the developer,
      # but has not yet been approved or rejected, * rejected – the
      # subscription request has been denied by an administrator, * cancelled –
      # the subscription has been cancelled by the developer or administrator,
      # * expired – the subscription reached its expiration date and was
      # deactivated. Possible values include: 'suspended', 'active', 'expired',
      # 'submitted', 'rejected', 'cancelled'
      attr_accessor :state

      # @return [DateTime] Subscription creation date. The date conforms to the
      # following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601
      # standard.
      #
      attr_accessor :created_date

      # @return [DateTime] Subscription activation date. The setting is for
      # audit purposes only and the subscription is not automatically
      # activated. The subscription lifecycle can be managed by using the
      # `state` property. The date conforms to the following format:
      # `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
      #
      attr_accessor :start_date

      # @return [DateTime] Subscription expiration date. The setting is for
      # audit purposes only and the subscription is not automatically expired.
      # The subscription lifecycle can be managed by using the `state`
      # property. The date conforms to the following format:
      # `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
      #
      attr_accessor :expiration_date

      # @return [DateTime] Date when subscription was cancelled or expired. The
      # setting is for audit purposes only and the subscription is not
      # automatically cancelled. The subscription lifecycle can be managed by
      # using the `state` property. The date conforms to the following format:
      # `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
      #
      attr_accessor :end_date

      # @return [DateTime] Upcoming subscription expiration notification date.
      # The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as
      # specified by the ISO 8601 standard.
      #
      attr_accessor :notification_date

      # @return [String] Subscription primary key.
      attr_accessor :primary_key

      # @return [String] Subscription secondary key.
      attr_accessor :secondary_key

      # @return [String] Optional subscription comment added by an
      # administrator.
      attr_accessor :state_comment

      # @return [Boolean] Determines whether tracing is enabled
      attr_accessor :allow_tracing


      #
      # Mapper for SubscriptionContract class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'SubscriptionContract',
          type: {
            name: 'Composite',
            class_name: 'SubscriptionContract',
            model_properties: {
              id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'id',
                type: {
                  name: 'String'
                }
              },
              name: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'name',
                type: {
                  name: 'String'
                }
              },
              type: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'type',
                type: {
                  name: 'String'
                }
              },
              owner_id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.ownerId',
                type: {
                  name: 'String'
                }
              },
              scope: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.scope',
                type: {
                  name: 'String'
                }
              },
              display_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.displayName',
                constraints: {
                  MaxLength: 100,
                  MinLength: 0
                },
                type: {
                  name: 'String'
                }
              },
              state: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.state',
                type: {
                  name: 'Enum',
                  module: 'SubscriptionState'
                }
              },
              created_date: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.createdDate',
                type: {
                  name: 'DateTime'
                }
              },
              start_date: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.startDate',
                type: {
                  name: 'DateTime'
                }
              },
              expiration_date: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.expirationDate',
                type: {
                  name: 'DateTime'
                }
              },
              end_date: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.endDate',
                type: {
                  name: 'DateTime'
                }
              },
              notification_date: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.notificationDate',
                type: {
                  name: 'DateTime'
                }
              },
              primary_key: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.primaryKey',
                constraints: {
                  MaxLength: 256,
                  MinLength: 1
                },
                type: {
                  name: 'String'
                }
              },
              secondary_key: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.secondaryKey',
                constraints: {
                  MaxLength: 256,
                  MinLength: 1
                },
                type: {
                  name: 'String'
                }
              },
              state_comment: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.stateComment',
                type: {
                  name: 'String'
                }
              },
              allow_tracing: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.allowTracing',
                type: {
                  name: 'Boolean'
                }
              }
            }
          }
        }
      end
    end
  end
end
