/*
* Copyright 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 location-2020-11-19.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.LocationService.Model
{
///
/// Container for the parameters to the CreateKey operation.
/// Creates an API key resource in your Amazon Web Services account, which lets you grant
/// actions for Amazon Location resources to the API key bearer.
///
///
///
/// For more information, see Using
/// API keys.
///
///
///
public partial class CreateKeyRequest : AmazonLocationServiceRequest
{
private string _description;
private DateTime? _expireTime;
private string _keyName;
private bool? _noExpiry;
private ApiKeyRestrictions _restrictions;
private Dictionary _tags = new Dictionary();
///
/// Gets and sets the property Description.
///
/// An optional description for the API key resource.
///
///
[AWSProperty(Min=0, Max=1000)]
public string Description
{
get { return this._description; }
set { this._description = value; }
}
// Check to see if Description property is set
internal bool IsSetDescription()
{
return this._description != null;
}
///
/// Gets and sets the property ExpireTime.
///
/// The optional timestamp for when the API key resource will expire in
/// ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ
. One of NoExpiry
/// or ExpireTime
must be set.
///
///
public DateTime ExpireTime
{
get { return this._expireTime.GetValueOrDefault(); }
set { this._expireTime = value; }
}
// Check to see if ExpireTime property is set
internal bool IsSetExpireTime()
{
return this._expireTime.HasValue;
}
///
/// Gets and sets the property KeyName.
///
/// A custom name for the API key resource.
///
///
///
/// Requirements:
///
/// -
///
/// Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and
/// underscores (_).
///
///
-
///
/// Must be a unique API key name.
///
///
-
///
/// No spaces allowed. For example,
ExampleAPIKey
.
///
///
///
[AWSProperty(Required=true, Min=1, Max=100)]
public string KeyName
{
get { return this._keyName; }
set { this._keyName = value; }
}
// Check to see if KeyName property is set
internal bool IsSetKeyName()
{
return this._keyName != null;
}
///
/// Gets and sets the property NoExpiry.
///
/// Optionally set to true
to set no expiration time for the API key. One
/// of NoExpiry
or ExpireTime
must be set.
///
///
public bool NoExpiry
{
get { return this._noExpiry.GetValueOrDefault(); }
set { this._noExpiry = value; }
}
// Check to see if NoExpiry property is set
internal bool IsSetNoExpiry()
{
return this._noExpiry.HasValue;
}
///
/// Gets and sets the property Restrictions.
///
/// The API key restrictions for the API key resource.
///
///
[AWSProperty(Required=true)]
public ApiKeyRestrictions Restrictions
{
get { return this._restrictions; }
set { this._restrictions = value; }
}
// Check to see if Restrictions property is set
internal bool IsSetRestrictions()
{
return this._restrictions != null;
}
///
/// Gets and sets the property Tags.
///
/// Applies one or more tags to the map resource. A tag is a key-value pair that helps
/// manage, identify, search, and filter your resources by labelling them.
///
///
///
/// Format: "key" : "value"
///
///
///
/// Restrictions:
///
/// -
///
/// Maximum 50 tags per resource
///
///
-
///
/// Each resource tag must be unique with a maximum of one value.
///
///
-
///
/// Maximum key length: 128 Unicode characters in UTF-8
///
///
-
///
/// Maximum value length: 256 Unicode characters in UTF-8
///
///
-
///
/// Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + -
/// = . _ : / @.
///
///
-
///
/// Cannot use "aws:" as a prefix for a key.
///
///
///
[AWSProperty(Min=0, Max=50)]
public Dictionary Tags
{
get { return this._tags; }
set { this._tags = value; }
}
// Check to see if Tags property is set
internal bool IsSetTags()
{
return this._tags != null && this._tags.Count > 0;
}
}
}