/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

const models = require('./index');

/**
 * An action group resource.
 *
 * @extends models['Resource']
 */
class ActionGroupResource extends models['Resource'] {
  /**
   * Create a ActionGroupResource.
   * @property {string} groupShortName The short name of the action group. This
   * will be used in SMS messages.
   * @property {boolean} enabled Indicates whether this action group is
   * enabled. If an action group is not enabled, then none of its receivers
   * will receive communications. Default value: true .
   * @property {array} [emailReceivers] The list of email receivers that are
   * part of this action group.
   * @property {array} [smsReceivers] The list of SMS receivers that are part
   * of this action group.
   * @property {array} [webhookReceivers] The list of webhook receivers that
   * are part of this action group.
   * @property {array} [itsmReceivers] The list of ITSM receivers that are part
   * of this action group.
   * @property {array} [azureAppPushReceivers] The list of AzureAppPush
   * receivers that are part of this action group.
   * @property {array} [automationRunbookReceivers] The list of
   * AutomationRunbook receivers that are part of this action group.
   * @property {array} [voiceReceivers] The list of voice receivers that are
   * part of this action group.
   * @property {array} [logicAppReceivers] The list of logic app receivers that
   * are part of this action group.
   * @property {array} [azureFunctionReceivers] The list of azure function
   * receivers that are part of this action group.
   * @property {array} [armRoleReceivers] The list of ARM role receivers that
   * are part of this action group. Roles are Azure RBAC roles and only
   * built-in roles are supported.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ActionGroupResource
   *
   * @returns {object} metadata of ActionGroupResource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ActionGroupResource',
      type: {
        name: 'Composite',
        className: 'ActionGroupResource',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          location: {
            required: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          groupShortName: {
            required: true,
            serializedName: 'properties.groupShortName',
            constraints: {
              MaxLength: 12
            },
            type: {
              name: 'String'
            }
          },
          enabled: {
            required: true,
            serializedName: 'properties.enabled',
            defaultValue: true,
            type: {
              name: 'Boolean'
            }
          },
          emailReceivers: {
            required: false,
            serializedName: 'properties.emailReceivers',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'EmailReceiverElementType',
                  type: {
                    name: 'Composite',
                    className: 'EmailReceiver'
                  }
              }
            }
          },
          smsReceivers: {
            required: false,
            serializedName: 'properties.smsReceivers',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'SmsReceiverElementType',
                  type: {
                    name: 'Composite',
                    className: 'SmsReceiver'
                  }
              }
            }
          },
          webhookReceivers: {
            required: false,
            serializedName: 'properties.webhookReceivers',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'WebhookReceiverElementType',
                  type: {
                    name: 'Composite',
                    className: 'WebhookReceiver'
                  }
              }
            }
          },
          itsmReceivers: {
            required: false,
            serializedName: 'properties.itsmReceivers',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ItsmReceiverElementType',
                  type: {
                    name: 'Composite',
                    className: 'ItsmReceiver'
                  }
              }
            }
          },
          azureAppPushReceivers: {
            required: false,
            serializedName: 'properties.azureAppPushReceivers',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'AzureAppPushReceiverElementType',
                  type: {
                    name: 'Composite',
                    className: 'AzureAppPushReceiver'
                  }
              }
            }
          },
          automationRunbookReceivers: {
            required: false,
            serializedName: 'properties.automationRunbookReceivers',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'AutomationRunbookReceiverElementType',
                  type: {
                    name: 'Composite',
                    className: 'AutomationRunbookReceiver'
                  }
              }
            }
          },
          voiceReceivers: {
            required: false,
            serializedName: 'properties.voiceReceivers',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'VoiceReceiverElementType',
                  type: {
                    name: 'Composite',
                    className: 'VoiceReceiver'
                  }
              }
            }
          },
          logicAppReceivers: {
            required: false,
            serializedName: 'properties.logicAppReceivers',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'LogicAppReceiverElementType',
                  type: {
                    name: 'Composite',
                    className: 'LogicAppReceiver'
                  }
              }
            }
          },
          azureFunctionReceivers: {
            required: false,
            serializedName: 'properties.azureFunctionReceivers',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'AzureFunctionReceiverElementType',
                  type: {
                    name: 'Composite',
                    className: 'AzureFunctionReceiver'
                  }
              }
            }
          },
          armRoleReceivers: {
            required: false,
            serializedName: 'properties.armRoleReceivers',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ArmRoleReceiverElementType',
                  type: {
                    name: 'Composite',
                    className: 'ArmRoleReceiver'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = ActionGroupResource;
