# 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::DataFactory::Mgmt::V2018_06_01
  module Models
    #
    # Common Data Service for Apps linked service.
    #
    class CommonDataServiceForAppsLinkedService < LinkedService

      include MsRestAzure


      def initialize
        @type = "CommonDataServiceForApps"
      end

      attr_accessor :type

      # @return [DynamicsDeploymentType] The deployment type of the Common Data
      # Service for Apps instance. 'Online' for Common Data Service for Apps
      # Online and 'OnPremisesWithIfd' for Common Data Service for Apps
      # on-premises with Ifd. Type: string (or Expression with resultType
      # string). Possible values include: 'Online', 'OnPremisesWithIfd'
      attr_accessor :deployment_type

      # @return The host name of the on-premises Common Data Service for Apps
      # server. The property is required for on-prem and not allowed for
      # online. Type: string (or Expression with resultType string).
      attr_accessor :host_name

      # @return The port of on-premises Common Data Service for Apps server.
      # The property is required for on-prem and not allowed for online.
      # Default is 443. Type: integer (or Expression with resultType integer),
      # minimum: 0.
      attr_accessor :port

      # @return The URL to the Microsoft Common Data Service for Apps server.
      # The property is required for on-line and not allowed for on-prem. Type:
      # string (or Expression with resultType string).
      attr_accessor :service_uri

      # @return The organization name of the Common Data Service for Apps
      # instance. The property is required for on-prem and required for online
      # when there are more than one Common Data Service for Apps instances
      # associated with the user. Type: string (or Expression with resultType
      # string).
      attr_accessor :organization_name

      # @return [DynamicsAuthenticationType] The authentication type to connect
      # to Common Data Service for Apps server. 'Office365' for online
      # scenario, 'Ifd' for on-premises with Ifd scenario.
      # 'AADServicePrincipal' for Server-To-Server authentication in online
      # scenario. Type: string (or Expression with resultType string). Possible
      # values include: 'Office365', 'Ifd', 'AADServicePrincipal'
      attr_accessor :authentication_type

      # @return User name to access the Common Data Service for Apps instance.
      # Type: string (or Expression with resultType string).
      attr_accessor :username

      # @return [SecretBase] Password to access the Common Data Service for
      # Apps instance.
      attr_accessor :password

      # @return The client ID of the application in Azure Active Directory used
      # for Server-To-Server authentication. Type: string (or Expression with
      # resultType string).
      attr_accessor :service_principal_id

      # @return The service principal credential type to use in
      # Server-To-Server authentication. 'ServicePrincipalKey' for key/secret,
      # 'ServicePrincipalCert' for certificate. Type: string (or Expression
      # with resultType string).
      attr_accessor :service_principal_credential_type

      # @return [SecretBase] The credential of the service principal object in
      # Azure Active Directory. If servicePrincipalCredentialType is
      # 'ServicePrincipalKey', servicePrincipalCredential can be SecureString
      # or AzureKeyVaultSecretReference. If servicePrincipalCredentialType is
      # 'ServicePrincipalCert', servicePrincipalCredential can only be
      # AzureKeyVaultSecretReference.
      attr_accessor :service_principal_credential

      # @return The encrypted credential used for authentication. Credentials
      # are encrypted using the integration runtime credential manager. Type:
      # string (or Expression with resultType string).
      attr_accessor :encrypted_credential


      #
      # Mapper for CommonDataServiceForAppsLinkedService class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'CommonDataServiceForApps',
          type: {
            name: 'Composite',
            class_name: 'CommonDataServiceForAppsLinkedService',
            model_properties: {
              additional_properties: {
                client_side_validation: true,
                required: false,
                type: {
                  name: 'Dictionary',
                  value: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ObjectElementType',
                      type: {
                        name: 'Object'
                      }
                  }
                }
              },
              connect_via: {
                client_side_validation: true,
                required: false,
                serialized_name: 'connectVia',
                type: {
                  name: 'Composite',
                  class_name: 'IntegrationRuntimeReference'
                }
              },
              description: {
                client_side_validation: true,
                required: false,
                serialized_name: 'description',
                type: {
                  name: 'String'
                }
              },
              parameters: {
                client_side_validation: true,
                required: false,
                serialized_name: 'parameters',
                type: {
                  name: 'Dictionary',
                  value: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ParameterSpecificationElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'ParameterSpecification'
                      }
                  }
                }
              },
              annotations: {
                client_side_validation: true,
                required: false,
                serialized_name: 'annotations',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ObjectElementType',
                      type: {
                        name: 'Object'
                      }
                  }
                }
              },
              type: {
                client_side_validation: true,
                required: true,
                serialized_name: 'type',
                type: {
                  name: 'String'
                }
              },
              deployment_type: {
                client_side_validation: true,
                required: true,
                serialized_name: 'typeProperties.deploymentType',
                type: {
                  name: 'String'
                }
              },
              host_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.hostName',
                type: {
                  name: 'Object'
                }
              },
              port: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.port',
                type: {
                  name: 'Object'
                }
              },
              service_uri: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.serviceUri',
                type: {
                  name: 'Object'
                }
              },
              organization_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.organizationName',
                type: {
                  name: 'Object'
                }
              },
              authentication_type: {
                client_side_validation: true,
                required: true,
                serialized_name: 'typeProperties.authenticationType',
                type: {
                  name: 'String'
                }
              },
              username: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.username',
                type: {
                  name: 'Object'
                }
              },
              password: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.password',
                type: {
                  name: 'Composite',
                  polymorphic_discriminator: 'type',
                  uber_parent: 'SecretBase',
                  class_name: 'SecretBase'
                }
              },
              service_principal_id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.servicePrincipalId',
                type: {
                  name: 'Object'
                }
              },
              service_principal_credential_type: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.servicePrincipalCredentialType',
                type: {
                  name: 'Object'
                }
              },
              service_principal_credential: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.servicePrincipalCredential',
                type: {
                  name: 'Composite',
                  polymorphic_discriminator: 'type',
                  uber_parent: 'SecretBase',
                  class_name: 'SecretBase'
                }
              },
              encrypted_credential: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.encryptedCredential',
                type: {
                  name: 'Object'
                }
              }
            }
          }
        }
      end
    end
  end
end
