/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the lambda-2015-03-31.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.Lambda.Model { /// /// Container for the parameters to the AddPermission operation. /// Grants an AWS service or another account permission to use a function. You can apply /// the policy at the function level, or specify a qualifier to restrict access to a single /// version or alias. If you use a qualifier, the invoker must use the full Amazon Resource /// Name (ARN) of that version or alias to invoke the function. /// /// /// /// To grant permission to another account, specify the account ID as the Principal. /// For AWS services, the principal is a domain-style identifier defined by the service, /// like s3.amazonaws.com or sns.amazonaws.com. For AWS services, /// you can also specify the ARN or owning account of the associated resource as the SourceArn /// or SourceAccount. If you grant permission to a service principal without /// specifying the source, other accounts could potentially configure resources in their /// account to invoke your Lambda function. /// /// /// /// This action adds a statement to a resource-based permissions policy for the function. /// For more information about function policies, see Lambda /// Function Policies. /// /// public partial class AddPermissionRequest : AmazonLambdaRequest { private string _action; private string _eventSourceToken; private string _functionName; private string _principal; private string _qualifier; private string _revisionId; private string _sourceAccount; private string _sourceArn; private string _statementId; /// /// Gets and sets the property Action. /// /// The action that the principal can use on the function. For example, lambda:InvokeFunction /// or lambda:GetFunction. /// /// [AWSProperty(Required=true)] public string Action { get { return this._action; } set { this._action = value; } } // Check to see if Action property is set internal bool IsSetAction() { return this._action != null; } /// /// Gets and sets the property EventSourceToken. /// /// For Alexa Smart Home functions, a token that must be supplied by the invoker. /// /// [AWSProperty(Min=0, Max=256)] public string EventSourceToken { get { return this._eventSourceToken; } set { this._eventSourceToken = value; } } // Check to see if EventSourceToken property is set internal bool IsSetEventSourceToken() { return this._eventSourceToken != null; } /// /// Gets and sets the property FunctionName. /// /// The name of the Lambda function, version, or alias. /// ///

Name formats /// ///

/// /// You can append a version number or alias to any of the formats. The length constraint /// applies only to the full ARN. If you specify only the function name, it is limited /// to 64 characters in length. /// ///
[AWSProperty(Required=true, Min=1, Max=140)] public string FunctionName { get { return this._functionName; } set { this._functionName = value; } } // Check to see if FunctionName property is set internal bool IsSetFunctionName() { return this._functionName != null; } /// /// Gets and sets the property Principal. /// /// The AWS service or account that invokes the function. If you specify a service, use /// SourceArn or SourceAccount to limit who can invoke the function /// through that service. /// /// [AWSProperty(Required=true)] public string Principal { get { return this._principal; } set { this._principal = value; } } // Check to see if Principal property is set internal bool IsSetPrincipal() { return this._principal != null; } /// /// Gets and sets the property Qualifier. /// /// Specify a version or alias to add permissions to a published version of the function. /// /// [AWSProperty(Min=1, Max=128)] public string Qualifier { get { return this._qualifier; } set { this._qualifier = value; } } // Check to see if Qualifier property is set internal bool IsSetQualifier() { return this._qualifier != null; } /// /// Gets and sets the property RevisionId. /// /// Only update the policy if the revision ID matches the ID that's specified. Use this /// option to avoid modifying a policy that has changed since you last read it. /// /// public string RevisionId { get { return this._revisionId; } set { this._revisionId = value; } } // Check to see if RevisionId property is set internal bool IsSetRevisionId() { return this._revisionId != null; } /// /// Gets and sets the property SourceAccount. /// /// For AWS services, the ID of the account that owns the resource. Use this instead of /// SourceArn to grant permission to resources that are owned by another /// account (for example, all of an account's Amazon S3 buckets). Or use it together with /// SourceArn to ensure that the resource is owned by the specified account. /// For example, an Amazon S3 bucket could be deleted by its owner and recreated by another /// account. /// /// public string SourceAccount { get { return this._sourceAccount; } set { this._sourceAccount = value; } } // Check to see if SourceAccount property is set internal bool IsSetSourceAccount() { return this._sourceAccount != null; } /// /// Gets and sets the property SourceArn. /// /// For AWS services, the ARN of the AWS resource that invokes the function. For example, /// an Amazon S3 bucket or Amazon SNS topic. /// /// public string SourceArn { get { return this._sourceArn; } set { this._sourceArn = value; } } // Check to see if SourceArn property is set internal bool IsSetSourceArn() { return this._sourceArn != null; } /// /// Gets and sets the property StatementId. /// /// A statement identifier that differentiates the statement from others in the same policy. /// /// [AWSProperty(Required=true, Min=1, Max=100)] public string StatementId { get { return this._statementId; } set { this._statementId = value; } } // Check to see if StatementId property is set internal bool IsSetStatementId() { return this._statementId != null; } } }