/*
 * 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');

/**
 * Defines an action.
 *
 * @extends models['CreativeWork']
 */
class Action extends models['CreativeWork'] {
  /**
   * Create a Action.
   * @property {array} [location]
   * @property {array} [result] The result produced in the action.
   * @property {string} [displayName] A display name for the action.
   * @property {boolean} [isTopAction] A Boolean representing whether this
   * result is the top action.
   * @property {string} [serviceUrl] Use this URL to get additional data to
   * determine how to take the appropriate action. For example, the serviceUrl
   * might return JSON along with an image URL.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Action
   *
   * @returns {object} metadata of Action
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Action',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: '_type',
          clientName: '_type'
        },
        uberParent: 'ResponseBase',
        className: 'Action',
        modelProperties: {
          _type: {
            required: true,
            serializedName: '_type',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          readLink: {
            required: false,
            readOnly: true,
            serializedName: 'readLink',
            type: {
              name: 'String'
            }
          },
          webSearchUrl: {
            required: false,
            readOnly: true,
            serializedName: 'webSearchUrl',
            type: {
              name: 'String'
            }
          },
          potentialAction: {
            required: false,
            readOnly: true,
            serializedName: 'potentialAction',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ActionElementType',
                  type: {
                    name: 'Composite',
                    polymorphicDiscriminator: {
                      serializedName: '_type',
                      clientName: '_type'
                    },
                    uberParent: 'ResponseBase',
                    className: 'Action'
                  }
              }
            }
          },
          immediateAction: {
            required: false,
            readOnly: true,
            serializedName: 'immediateAction',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ActionElementType',
                  type: {
                    name: 'Composite',
                    polymorphicDiscriminator: {
                      serializedName: '_type',
                      clientName: '_type'
                    },
                    uberParent: 'ResponseBase',
                    className: 'Action'
                  }
              }
            }
          },
          preferredClickthroughUrl: {
            required: false,
            readOnly: true,
            serializedName: 'preferredClickthroughUrl',
            type: {
              name: 'String'
            }
          },
          adaptiveCard: {
            required: false,
            readOnly: true,
            serializedName: 'adaptiveCard',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          url: {
            required: false,
            readOnly: true,
            serializedName: 'url',
            type: {
              name: 'String'
            }
          },
          entityPresentationInfo: {
            required: false,
            readOnly: true,
            serializedName: 'entityPresentationInfo',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: '_type',
                clientName: '_type'
              },
              uberParent: 'EntitiesEntityPresentationInfo',
              className: 'EntitiesEntityPresentationInfo'
            }
          },
          thumbnailUrl: {
            required: false,
            readOnly: true,
            serializedName: 'thumbnailUrl',
            type: {
              name: 'String'
            }
          },
          about: {
            required: false,
            readOnly: true,
            serializedName: 'about',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ThingElementType',
                  type: {
                    name: 'Composite',
                    polymorphicDiscriminator: {
                      serializedName: '_type',
                      clientName: '_type'
                    },
                    uberParent: 'ResponseBase',
                    className: 'Thing'
                  }
              }
            }
          },
          mentions: {
            required: false,
            readOnly: true,
            serializedName: 'mentions',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ThingElementType',
                  type: {
                    name: 'Composite',
                    polymorphicDiscriminator: {
                      serializedName: '_type',
                      clientName: '_type'
                    },
                    uberParent: 'ResponseBase',
                    className: 'Thing'
                  }
              }
            }
          },
          provider: {
            required: false,
            readOnly: true,
            serializedName: 'provider',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ThingElementType',
                  type: {
                    name: 'Composite',
                    polymorphicDiscriminator: {
                      serializedName: '_type',
                      clientName: '_type'
                    },
                    uberParent: 'ResponseBase',
                    className: 'Thing'
                  }
              }
            }
          },
          creator: {
            required: false,
            readOnly: true,
            serializedName: 'creator',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: '_type',
                clientName: '_type'
              },
              uberParent: 'ResponseBase',
              className: 'Thing'
            }
          },
          text: {
            required: false,
            readOnly: true,
            serializedName: 'text',
            type: {
              name: 'String'
            }
          },
          discussionUrl: {
            required: false,
            readOnly: true,
            serializedName: 'discussionUrl',
            type: {
              name: 'String'
            }
          },
          commentCount: {
            required: false,
            readOnly: true,
            serializedName: 'commentCount',
            type: {
              name: 'Number'
            }
          },
          mainEntity: {
            required: false,
            readOnly: true,
            serializedName: 'mainEntity',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: '_type',
                clientName: '_type'
              },
              uberParent: 'ResponseBase',
              className: 'Thing'
            }
          },
          headLine: {
            required: false,
            readOnly: true,
            serializedName: 'headLine',
            type: {
              name: 'String'
            }
          },
          copyrightHolder: {
            required: false,
            readOnly: true,
            serializedName: 'copyrightHolder',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: '_type',
                clientName: '_type'
              },
              uberParent: 'ResponseBase',
              className: 'Thing'
            }
          },
          copyrightYear: {
            required: false,
            readOnly: true,
            serializedName: 'copyrightYear',
            type: {
              name: 'Number'
            }
          },
          disclaimer: {
            required: false,
            readOnly: true,
            serializedName: 'disclaimer',
            type: {
              name: 'String'
            }
          },
          isAccessibleForFree: {
            required: false,
            readOnly: true,
            serializedName: 'isAccessibleForFree',
            type: {
              name: 'Boolean'
            }
          },
          genre: {
            required: false,
            readOnly: true,
            serializedName: 'genre',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          isFamilyFriendly: {
            required: false,
            readOnly: true,
            serializedName: 'isFamilyFriendly',
            type: {
              name: 'Boolean'
            }
          },
          location: {
            required: false,
            readOnly: true,
            serializedName: 'location',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'PlaceElementType',
                  type: {
                    name: 'Composite',
                    polymorphicDiscriminator: {
                      serializedName: '_type',
                      clientName: '_type'
                    },
                    uberParent: 'ResponseBase',
                    className: 'Place'
                  }
              }
            }
          },
          result: {
            required: false,
            readOnly: true,
            serializedName: 'result',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ThingElementType',
                  type: {
                    name: 'Composite',
                    polymorphicDiscriminator: {
                      serializedName: '_type',
                      clientName: '_type'
                    },
                    uberParent: 'ResponseBase',
                    className: 'Thing'
                  }
              }
            }
          },
          displayName: {
            required: false,
            readOnly: true,
            serializedName: 'displayName',
            type: {
              name: 'String'
            }
          },
          isTopAction: {
            required: false,
            readOnly: true,
            serializedName: 'isTopAction',
            type: {
              name: 'Boolean'
            }
          },
          serviceUrl: {
            required: false,
            readOnly: true,
            serializedName: 'serviceUrl',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = Action;
