text
stringlengths
1
22.8M
```php <?php /** * * * path_to_url * * 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 */ namespace Aws\CloudFront\Enum; use Aws\Common\Enum; /** * Contains enumerable PriceClass values */ class PriceClass extends Enum { const PRICE_CLASS_100 = 'PriceClass_100'; const PRICE_CLASS_200 = 'PriceClass_200'; const PRICE_CLASS_ALL = 'PriceClass_All'; } ```
Sten Hugo Ziegler (born 30 May 1950 in Copenhagen) is a Danish former football player who played for Hvidovre IF in Denmark and Roda JC and Ajax in the Netherlands. He played 25 games and scored one goal for the Danish national team from 1971 to 1981, and represented Denmark at the 1972 Summer Olympics football tournament. External links 1950 births Living people Footballers from Copenhagen Danish men's footballers Hvidovre IF players AFC Ajax players Roda JC Kerkrade players Eredivisie players Denmark men's international footballers Danish expatriate men's footballers Danish expatriate sportspeople in the Netherlands Expatriate men's footballers in the Netherlands Footballers at the 1972 Summer Olympics Olympic footballers for Denmark Men's association football midfielders
Smārde Station is a railway station on the Torņakalns – Tukums II Railway. References External links Railway stations in Latvia Railway stations in the Russian Empire opened in 1877
CAMC may refer to: Charleston Area Medical Center, a complex of hospitals in Charleston, West Virginia Carlsberg Meridian Telescope, formerly known as the Carlsberg Automatic Meridian Circle Computer-Aided Manufacturing Capability Committee on the American Mathematics Competitions, the organization that oversees the American Mathematics Competitions A brand name of Chinese truck manufacturer Hualing Xingma
Iffigsee is a lake near Lenk, in the canton of Berne, Switzerland. The lake is located in the Iffigtal, near Rawil Pass. To the south of the lake is the Wildhorn (3,248 metres). See also List of mountain lakes of Switzerland References Lakes of Switzerland Bernese Oberland Lakes of the canton of Bern LIffigsee
```c++ //file LICENSE_1_0.txt or copy at path_to_url #include <boost/qvm/vec_traits.hpp> #include <boost/qvm/swizzle3.hpp> #include <boost/detail/lightweight_test.hpp> template <int D> struct my_vec { }; int called=0; namespace boost { namespace qvm { void YYY(...) { BOOST_TEST(0); } void XXZ(...) { ++called; } template <int D> struct vec_traits< my_vec<D> > { typedef int scalar_type; static int const dim=D; template <int I> static int read_element( my_vec<D> const & ); template <int I> static int & write_element( my_vec<D> & ); }; } } int main() { using namespace boost::qvm; YYY(my_vec<2>()); XXZ(my_vec<2>()); BOOST_TEST(called==1); return boost::report_errors(); } ```
```c++ #include <gtest/gtest.h> #include <ATen/core/operator_name.h> TEST(OperatorNameTest, SetNamespaceIfNotSetWithoutExistingNamespace) { c10::OperatorName testName("operator", "operator.overload"); const auto result = testName.setNamespaceIfNotSet("ns"); EXPECT_TRUE(result); EXPECT_EQ(testName.name, "ns::operator"); EXPECT_EQ(testName.overload_name, "operator.overload"); EXPECT_EQ(testName.getNamespace(), std::optional<c10::string_view>("ns")); } TEST(OperatorNameTest, SetNamespaceIfNotSetWithExistingNamespace) { c10::OperatorName namespacedName("already_namespaced::operator", "operator.overload"); const auto result = namespacedName.setNamespaceIfNotSet("namespace"); EXPECT_FALSE(result); EXPECT_EQ(namespacedName.name, "already_namespaced::operator"); EXPECT_EQ(namespacedName.overload_name, "operator.overload"); EXPECT_EQ(namespacedName.getNamespace(), std::optional<c10::string_view>("already_namespaced")); } ```
```php <?php namespace Spatie\SchemaOrg; use Spatie\SchemaOrg\Contracts\DietarySupplementContract; use Spatie\SchemaOrg\Contracts\MedicalEntityContract; use Spatie\SchemaOrg\Contracts\ProductContract; use Spatie\SchemaOrg\Contracts\SubstanceContract; use Spatie\SchemaOrg\Contracts\ThingContract; /** * A product taken by mouth that contains a dietary ingredient intended to * supplement the diet. Dietary ingredients may include vitamins, minerals, * herbs or other botanicals, amino acids, and substances such as enzymes, organ * tissues, glandulars and metabolites. * * @see path_to_url * @see path_to_url * */ class DietarySupplement extends BaseType implements DietarySupplementContract, MedicalEntityContract, ProductContract, SubstanceContract, ThingContract { /** * An active ingredient, typically chemical compounds and/or biologic * substances. * * @param string|string[] $activeIngredient * * @return static * * @see path_to_url * @see path_to_url */ public function activeIngredient($activeIngredient) { return $this->setProperty('activeIngredient', $activeIngredient); } /** * A property-value pair representing an additional characteristic of the * entity, e.g. a product feature or another characteristic for which there * is no matching property in schema.org. * * Note: Publishers should be aware that applications designed to use * specific schema.org properties (e.g. path_to_url * path_to_url path_to_url ...) will typically * expect such data to be provided using those properties, rather than using * the generic property/value mechanism. * * @param \Spatie\SchemaOrg\Contracts\PropertyValueContract|\Spatie\SchemaOrg\Contracts\PropertyValueContract[] $additionalProperty * * @return static * * @see path_to_url */ public function additionalProperty($additionalProperty) { return $this->setProperty('additionalProperty', $additionalProperty); } /** * An additional type for the item, typically used for adding more specific * types from external vocabularies in microdata syntax. This is a * relationship between something and a class that the thing is in. * Typically the value is a URI-identified RDF class, and in this case * corresponds to the * use of rdf:type in RDF. Text values can be used sparingly, for cases * where useful information can be added without their being an appropriate * schema to reference. In the case of text values, the class label should * follow the schema.org [style * guide](path_to_url * * @param string|string[] $additionalType * * @return static * * @see path_to_url */ public function additionalType($additionalType) { return $this->setProperty('additionalType', $additionalType); } /** * The overall rating, based on a collection of reviews or ratings, of the * item. * * @param \Spatie\SchemaOrg\Contracts\AggregateRatingContract|\Spatie\SchemaOrg\Contracts\AggregateRatingContract[] $aggregateRating * * @return static * * @see path_to_url */ public function aggregateRating($aggregateRating) { return $this->setProperty('aggregateRating', $aggregateRating); } /** * An alias for the item. * * @param string|string[] $alternateName * * @return static * * @see path_to_url */ public function alternateName($alternateName) { return $this->setProperty('alternateName', $alternateName); } /** * An Amazon Standard Identification Number (ASIN) is a 10-character * alphanumeric unique identifier assigned by Amazon.com and its partners * for product identification within the Amazon organization (summary from * [Wikipedia](path_to_url * article). * * Note also that this is a definition for how to include ASINs in * Schema.org data, and not a definition of ASINs in general - see * documentation from Amazon for authoritative details. * ASINs are most commonly encoded as text strings, but the [asin] property * supports URL/URI as potential values too. * * @param string|string[] $asin * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function asin($asin) { return $this->setProperty('asin', $asin); } /** * An intended audience, i.e. a group for whom something was created. * * @param \Spatie\SchemaOrg\Contracts\AudienceContract|\Spatie\SchemaOrg\Contracts\AudienceContract[] $audience * * @return static * * @see path_to_url */ public function audience($audience) { return $this->setProperty('audience', $audience); } /** * An award won by or for this item. * * @param string|string[] $award * * @return static * * @see path_to_url */ public function award($award) { return $this->setProperty('award', $award); } /** * Awards won by or for this item. * * @param string|string[] $awards * * @return static * * @see path_to_url */ public function awards($awards) { return $this->setProperty('awards', $awards); } /** * The brand(s) associated with a product or service, or the brand(s) * maintained by an organization or business person. * * @param \Spatie\SchemaOrg\Contracts\BrandContract|\Spatie\SchemaOrg\Contracts\BrandContract[]|\Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[] $brand * * @return static * * @see path_to_url */ public function brand($brand) { return $this->setProperty('brand', $brand); } /** * A category for the item. Greater signs or slashes can be used to * informally indicate a category hierarchy. * * @param \Spatie\SchemaOrg\Contracts\CategoryCodeContract|\Spatie\SchemaOrg\Contracts\CategoryCodeContract[]|\Spatie\SchemaOrg\Contracts\PhysicalActivityCategoryContract|\Spatie\SchemaOrg\Contracts\PhysicalActivityCategoryContract[]|\Spatie\SchemaOrg\Contracts\ThingContract|\Spatie\SchemaOrg\Contracts\ThingContract[]|string|string[] $category * * @return static * * @see path_to_url */ public function category($category) { return $this->setProperty('category', $category); } /** * A medical code for the entity, taken from a controlled vocabulary or * ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc. * * @param \Spatie\SchemaOrg\Contracts\MedicalCodeContract|\Spatie\SchemaOrg\Contracts\MedicalCodeContract[] $code * * @return static * * @see path_to_url * @see path_to_url */ public function code($code) { return $this->setProperty('code', $code); } /** * The color of the product. * * @param string|string[] $color * * @return static * * @see path_to_url */ public function color($color) { return $this->setProperty('color', $color); } /** * The place where the product was assembled. * * @param string|string[] $countryOfAssembly * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function countryOfAssembly($countryOfAssembly) { return $this->setProperty('countryOfAssembly', $countryOfAssembly); } /** * The place where the item (typically [[Product]]) was last processed and * tested before importation. * * @param string|string[] $countryOfLastProcessing * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function countryOfLastProcessing($countryOfLastProcessing) { return $this->setProperty('countryOfLastProcessing', $countryOfLastProcessing); } /** * The country of origin of something, including products as well as * creative works such as movie and TV content. * * In the case of TV and movie, this would be the country of the principle * offices of the production company or individual responsible for the * movie. For other kinds of [[CreativeWork]] it is difficult to provide * fully general guidance, and properties such as [[contentLocation]] and * [[locationCreated]] may be more applicable. * * In the case of products, the country of origin of the product. The exact * interpretation of this may vary by context and product type, and cannot * be fully enumerated here. * * @param \Spatie\SchemaOrg\Contracts\CountryContract|\Spatie\SchemaOrg\Contracts\CountryContract[] $countryOfOrigin * * @return static * * @see path_to_url */ public function countryOfOrigin($countryOfOrigin) { return $this->setProperty('countryOfOrigin', $countryOfOrigin); } /** * The depth of the item. * * @param \Spatie\SchemaOrg\Contracts\DistanceContract|\Spatie\SchemaOrg\Contracts\DistanceContract[]|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract[] $depth * * @return static * * @see path_to_url */ public function depth($depth) { return $this->setProperty('depth', $depth); } /** * A description of the item. * * @param \Spatie\SchemaOrg\Contracts\TextObjectContract|\Spatie\SchemaOrg\Contracts\TextObjectContract[]|string|string[] $description * * @return static * * @see path_to_url */ public function description($description) { return $this->setProperty('description', $description); } /** * A sub property of description. A short description of the item used to * disambiguate from other, similar items. Information from other properties * (in particular, name) may be necessary for the description to be useful * for disambiguation. * * @param string|string[] $disambiguatingDescription * * @return static * * @see path_to_url */ public function disambiguatingDescription($disambiguatingDescription) { return $this->setProperty('disambiguatingDescription', $disambiguatingDescription); } /** * A [[Grant]] that directly or indirectly provide funding or sponsorship * for this item. See also [[ownershipFundingInfo]]. * * @param \Spatie\SchemaOrg\Contracts\GrantContract|\Spatie\SchemaOrg\Contracts\GrantContract[] $funding * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function funding($funding) { return $this->setProperty('funding', $funding); } /** * A Global Trade Item Number * ([GTIN](path_to_url GTINs identify * trade items, including products and services, using numeric * identification codes. * * The GS1 [digital link * specifications](path_to_url express * GTINs as URLs (URIs, IRIs, etc.). Details including regular expression * examples can be found in, Section 6 of the GS1 URI Syntax specification; * see also [schema.org tracking * issue](path_to_url#issuecomment-1209522809) * for schema.org-specific discussion. A correct [[gtin]] value should be a * valid GTIN, which means that it should be an all-numeric string of either * 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a * string. The numeric component should also have a [valid GS1 check * digit](path_to_url and meet the * other rules for valid GTINs. See also [GS1's GTIN * Summary](path_to_url and * [Wikipedia](path_to_url for * more details. Left-padding of the gtin values is not required or * encouraged. The [[gtin]] property generalizes the earlier [[gtin8]], * [[gtin12]], [[gtin13]], and [[gtin14]] properties. * * Note also that this is a definition for how to include GTINs in * Schema.org data, and not a definition of GTINs in general - see the GS1 * documentation for authoritative details. * * @param string|string[] $gtin * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function gtin($gtin) { return $this->setProperty('gtin', $gtin); } /** * The GTIN-12 code of the product, or the product to which the offer * refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a * U.P.C. Company Prefix, Item Reference, and Check Digit used to identify * trade items. See [GS1 GTIN * Summary](path_to_url for more * details. * * @param string|string[] $gtin12 * * @return static * * @see path_to_url */ public function gtin12($gtin12) { return $this->setProperty('gtin12', $gtin12); } /** * The GTIN-13 code of the product, or the product to which the offer * refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former * 12-digit UPC codes can be converted into a GTIN-13 code by simply adding * a preceding zero. See [GS1 GTIN * Summary](path_to_url for more * details. * * @param string|string[] $gtin13 * * @return static * * @see path_to_url */ public function gtin13($gtin13) { return $this->setProperty('gtin13', $gtin13); } /** * The GTIN-14 code of the product, or the product to which the offer * refers. See [GS1 GTIN * Summary](path_to_url for more * details. * * @param string|string[] $gtin14 * * @return static * * @see path_to_url */ public function gtin14($gtin14) { return $this->setProperty('gtin14', $gtin14); } /** * The GTIN-8 code of the product, or the product to which the offer refers. * This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN * Summary](path_to_url for more * details. * * @param string|string[] $gtin8 * * @return static * * @see path_to_url */ public function gtin8($gtin8) { return $this->setProperty('gtin8', $gtin8); } /** * A medical guideline related to this entity. * * @param \Spatie\SchemaOrg\Contracts\MedicalGuidelineContract|\Spatie\SchemaOrg\Contracts\MedicalGuidelineContract[] $guideline * * @return static * * @see path_to_url * @see path_to_url */ public function guideline($guideline) { return $this->setProperty('guideline', $guideline); } /** * Used to tag an item to be intended or suitable for consumption or use by * adults only. * * @param \Spatie\SchemaOrg\Contracts\AdultOrientedEnumerationContract|\Spatie\SchemaOrg\Contracts\AdultOrientedEnumerationContract[] $hasAdultConsideration * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function hasAdultConsideration($hasAdultConsideration) { return $this->setProperty('hasAdultConsideration', $hasAdultConsideration); } /** * Defines the energy efficiency Category (also known as "class" or * "rating") for a product according to an international energy efficiency * standard. * * @param \Spatie\SchemaOrg\Contracts\EnergyConsumptionDetailsContract|\Spatie\SchemaOrg\Contracts\EnergyConsumptionDetailsContract[] $hasEnergyConsumptionDetails * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function hasEnergyConsumptionDetails($hasEnergyConsumptionDetails) { return $this->setProperty('hasEnergyConsumptionDetails', $hasEnergyConsumptionDetails); } /** * A product measurement, for example the inseam of pants, the wheel size of * a bicycle, or the gauge of a screw. Usually an exact measurement, but can * also be a range of measurements for adjustable products, for example * belts and ski bindings. * * @param \Spatie\SchemaOrg\Contracts\QuantitativeValueContract|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract[] $hasMeasurement * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function hasMeasurement($hasMeasurement) { return $this->setProperty('hasMeasurement', $hasMeasurement); } /** * Specifies a MerchantReturnPolicy that may be applicable. * * @param \Spatie\SchemaOrg\Contracts\MerchantReturnPolicyContract|\Spatie\SchemaOrg\Contracts\MerchantReturnPolicyContract[] $hasMerchantReturnPolicy * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function hasMerchantReturnPolicy($hasMerchantReturnPolicy) { return $this->setProperty('hasMerchantReturnPolicy', $hasMerchantReturnPolicy); } /** * Indicates a ProductReturnPolicy that may be applicable. * * @param \Spatie\SchemaOrg\Contracts\ProductReturnPolicyContract|\Spatie\SchemaOrg\Contracts\ProductReturnPolicyContract[] $hasProductReturnPolicy * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function hasProductReturnPolicy($hasProductReturnPolicy) { return $this->setProperty('hasProductReturnPolicy', $hasProductReturnPolicy); } /** * The height of the item. * * @param \Spatie\SchemaOrg\Contracts\DistanceContract|\Spatie\SchemaOrg\Contracts\DistanceContract[]|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract[] $height * * @return static * * @see path_to_url */ public function height($height) { return $this->setProperty('height', $height); } /** * The identifier property represents any kind of identifier for any kind of * [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides * dedicated properties for representing many of these, either as textual * strings or as URL (URI) links. See [background * notes](/docs/datamodel.html#identifierBg) for more details. * * @param \Spatie\SchemaOrg\Contracts\PropertyValueContract|\Spatie\SchemaOrg\Contracts\PropertyValueContract[]|string|string[] $identifier * * @return static * * @see path_to_url */ public function identifier($identifier) { return $this->setProperty('identifier', $identifier); } /** * An image of the item. This can be a [[URL]] or a fully described * [[ImageObject]]. * * @param \Spatie\SchemaOrg\Contracts\ImageObjectContract|\Spatie\SchemaOrg\Contracts\ImageObjectContract[]|string|string[] $image * * @return static * * @see path_to_url */ public function image($image) { return $this->setProperty('image', $image); } /** * Indicates the [[productGroupID]] for a [[ProductGroup]] that this product * [[isVariantOf]]. * * @param string|string[] $inProductGroupWithID * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function inProductGroupWithID($inProductGroupWithID) { return $this->setProperty('inProductGroupWithID', $inProductGroupWithID); } /** * A pointer to another product (or multiple products) for which this * product is an accessory or spare part. * * @param \Spatie\SchemaOrg\Contracts\ProductContract|\Spatie\SchemaOrg\Contracts\ProductContract[] $isAccessoryOrSparePartFor * * @return static * * @see path_to_url */ public function isAccessoryOrSparePartFor($isAccessoryOrSparePartFor) { return $this->setProperty('isAccessoryOrSparePartFor', $isAccessoryOrSparePartFor); } /** * A pointer to another product (or multiple products) for which this * product is a consumable. * * @param \Spatie\SchemaOrg\Contracts\ProductContract|\Spatie\SchemaOrg\Contracts\ProductContract[] $isConsumableFor * * @return static * * @see path_to_url */ public function isConsumableFor($isConsumableFor) { return $this->setProperty('isConsumableFor', $isConsumableFor); } /** * Indicates whether this content is family friendly. * * @param bool|bool[] $isFamilyFriendly * * @return static * * @see path_to_url */ public function isFamilyFriendly($isFamilyFriendly) { return $this->setProperty('isFamilyFriendly', $isFamilyFriendly); } /** * True if this item's name is a proprietary/brand name (vs. generic name). * * @param bool|bool[] $isProprietary * * @return static * * @see path_to_url * @see path_to_url */ public function isProprietary($isProprietary) { return $this->setProperty('isProprietary', $isProprietary); } /** * A pointer to another, somehow related product (or multiple products). * * @param \Spatie\SchemaOrg\Contracts\ProductContract|\Spatie\SchemaOrg\Contracts\ProductContract[]|\Spatie\SchemaOrg\Contracts\ServiceContract|\Spatie\SchemaOrg\Contracts\ServiceContract[] $isRelatedTo * * @return static * * @see path_to_url */ public function isRelatedTo($isRelatedTo) { return $this->setProperty('isRelatedTo', $isRelatedTo); } /** * A pointer to another, functionally similar product (or multiple * products). * * @param \Spatie\SchemaOrg\Contracts\ProductContract|\Spatie\SchemaOrg\Contracts\ProductContract[]|\Spatie\SchemaOrg\Contracts\ServiceContract|\Spatie\SchemaOrg\Contracts\ServiceContract[] $isSimilarTo * * @return static * * @see path_to_url */ public function isSimilarTo($isSimilarTo) { return $this->setProperty('isSimilarTo', $isSimilarTo); } /** * Indicates the kind of product that this is a variant of. In the case of * [[ProductModel]], this is a pointer (from a ProductModel) to a base * product from which this product is a variant. It is safe to infer that * the variant inherits all product features from the base model, unless * defined locally. This is not transitive. In the case of a * [[ProductGroup]], the group description also serves as a template, * representing a set of Products that vary on explicitly defined, specific * dimensions only (so it defines both a set of variants, as well as which * values distinguish amongst those variants). When used with * [[ProductGroup]], this property can apply to any [[Product]] included in * the group. * * @param \Spatie\SchemaOrg\Contracts\ProductGroupContract|\Spatie\SchemaOrg\Contracts\ProductGroupContract[]|\Spatie\SchemaOrg\Contracts\ProductModelContract|\Spatie\SchemaOrg\Contracts\ProductModelContract[] $isVariantOf * * @return static * * @see path_to_url */ public function isVariantOf($isVariantOf) { return $this->setProperty('isVariantOf', $isVariantOf); } /** * A predefined value from OfferItemCondition specifying the condition of * the product or service, or the products or services included in the * offer. Also used for product return policies to specify the condition of * products accepted for returns. * * @param \Spatie\SchemaOrg\Contracts\OfferItemConditionContract|\Spatie\SchemaOrg\Contracts\OfferItemConditionContract[] $itemCondition * * @return static * * @see path_to_url */ public function itemCondition($itemCondition) { return $this->setProperty('itemCondition', $itemCondition); } /** * Keywords or tags used to describe some item. Multiple textual entries in * a keywords list are typically delimited by commas, or by repeating the * property. * * @param \Spatie\SchemaOrg\Contracts\DefinedTermContract|\Spatie\SchemaOrg\Contracts\DefinedTermContract[]|string|string[] $keywords * * @return static * * @see path_to_url */ public function keywords($keywords) { return $this->setProperty('keywords', $keywords); } /** * The drug or supplement's legal status, including any controlled substance * schedules that apply. * * @param \Spatie\SchemaOrg\Contracts\DrugLegalStatusContract|\Spatie\SchemaOrg\Contracts\DrugLegalStatusContract[]|\Spatie\SchemaOrg\Contracts\MedicalEnumerationContract|\Spatie\SchemaOrg\Contracts\MedicalEnumerationContract[]|string|string[] $legalStatus * * @return static * * @see path_to_url * @see path_to_url */ public function legalStatus($legalStatus) { return $this->setProperty('legalStatus', $legalStatus); } /** * An associated logo. * * @param \Spatie\SchemaOrg\Contracts\ImageObjectContract|\Spatie\SchemaOrg\Contracts\ImageObjectContract[]|string|string[] $logo * * @return static * * @see path_to_url */ public function logo($logo) { return $this->setProperty('logo', $logo); } /** * Indicates a page (or other CreativeWork) for which this thing is the main * entity being described. See [background * notes](/docs/datamodel.html#mainEntityBackground) for details. * * @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|string|string[] $mainEntityOfPage * * @return static * * @see path_to_url */ public function mainEntityOfPage($mainEntityOfPage) { return $this->setProperty('mainEntityOfPage', $mainEntityOfPage); } /** * The manufacturer of the product. * * @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[] $manufacturer * * @return static * * @see path_to_url */ public function manufacturer($manufacturer) { return $this->setProperty('manufacturer', $manufacturer); } /** * A material that something is made from, e.g. leather, wool, cotton, * paper. * * @param \Spatie\SchemaOrg\Contracts\ProductContract|\Spatie\SchemaOrg\Contracts\ProductContract[]|string|string[] $material * * @return static * * @see path_to_url */ public function material($material) { return $this->setProperty('material', $material); } /** * Recommended intake of this supplement for a given population as defined * by a specific recommending authority. * * @param \Spatie\SchemaOrg\Contracts\MaximumDoseScheduleContract|\Spatie\SchemaOrg\Contracts\MaximumDoseScheduleContract[] $maximumIntake * * @return static * * @see path_to_url * @see path_to_url */ public function maximumIntake($maximumIntake) { return $this->setProperty('maximumIntake', $maximumIntake); } /** * The specific biochemical interaction through which this drug or * supplement produces its pharmacological effect. * * @param string|string[] $mechanismOfAction * * @return static * * @see path_to_url * @see path_to_url */ public function mechanismOfAction($mechanismOfAction) { return $this->setProperty('mechanismOfAction', $mechanismOfAction); } /** * The system of medicine that includes this MedicalEntity, for example * 'evidence-based', 'homeopathic', 'chiropractic', etc. * * @param \Spatie\SchemaOrg\Contracts\MedicineSystemContract|\Spatie\SchemaOrg\Contracts\MedicineSystemContract[] $medicineSystem * * @return static * * @see path_to_url * @see path_to_url */ public function medicineSystem($medicineSystem) { return $this->setProperty('medicineSystem', $medicineSystem); } /** * The [[mobileUrl]] property is provided for specific situations in which * data consumers need to determine whether one of several provided URLs is * a dedicated 'mobile site'. * * To discourage over-use, and reflecting intial usecases, the property is * expected only on [[Product]] and [[Offer]], rather than [[Thing]]. The * general trend in web technology is towards [responsive * design](path_to_url in which * content can be flexibly adapted to a wide range of browsing environments. * Pages and sites referenced with the long-established [[url]] property * should ideally also be usable on a wide variety of devices, including * mobile phones. In most cases, it would be pointless and counter * productive to attempt to update all [[url]] markup to use [[mobileUrl]] * for more mobile-oriented pages. The property is intended for the case * when items (primarily [[Product]] and [[Offer]]) have extra URLs hosted * on an additional "mobile site" alongside the main one. It should not be * taken as an endorsement of this publication style. * * @param string|string[] $mobileUrl * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function mobileUrl($mobileUrl) { return $this->setProperty('mobileUrl', $mobileUrl); } /** * The model of the product. Use with the URL of a ProductModel or a textual * representation of the model identifier. The URL of the ProductModel can * be from an external source. It is recommended to additionally provide * strong product identifiers via the gtin8/gtin13/gtin14 and mpn * properties. * * @param \Spatie\SchemaOrg\Contracts\ProductModelContract|\Spatie\SchemaOrg\Contracts\ProductModelContract[]|string|string[] $model * * @return static * * @see path_to_url */ public function model($model) { return $this->setProperty('model', $model); } /** * The Manufacturer Part Number (MPN) of the product, or the product to * which the offer refers. * * @param string|string[] $mpn * * @return static * * @see path_to_url */ public function mpn($mpn) { return $this->setProperty('mpn', $mpn); } /** * The name of the item. * * @param string|string[] $name * * @return static * * @see path_to_url */ public function name($name) { return $this->setProperty('name', $name); } /** * Provides negative considerations regarding something, most typically in * pro/con lists for reviews (alongside [[positiveNotes]]). For symmetry * * In the case of a [[Review]], the property describes the [[itemReviewed]] * from the perspective of the review; in the case of a [[Product]], the * product itself is being described. Since product descriptions * tend to emphasise positive claims, it may be relatively unusual to find * [[negativeNotes]] used in this way. Nevertheless for the sake of * symmetry, [[negativeNotes]] can be used on [[Product]]. * * The property values can be expressed either as unstructured text * (repeated as necessary), or if ordered, as a list (in which case the most * negative is at the beginning of the list). * * @param \Spatie\SchemaOrg\Contracts\ItemListContract|\Spatie\SchemaOrg\Contracts\ItemListContract[]|\Spatie\SchemaOrg\Contracts\ListItemContract|\Spatie\SchemaOrg\Contracts\ListItemContract[]|\Spatie\SchemaOrg\Contracts\WebContentContract|\Spatie\SchemaOrg\Contracts\WebContentContract[]|string|string[] $negativeNotes * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function negativeNotes($negativeNotes) { return $this->setProperty('negativeNotes', $negativeNotes); } /** * The generic name of this drug or supplement. * * @param string|string[] $nonProprietaryName * * @return static * * @see path_to_url * @see path_to_url */ public function nonProprietaryName($nonProprietaryName) { return $this->setProperty('nonProprietaryName', $nonProprietaryName); } /** * Indicates the [NATO stock * number](path_to_url (nsn) of a * [[Product]]. * * @param string|string[] $nsn * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function nsn($nsn) { return $this->setProperty('nsn', $nsn); } /** * An offer to provide this item&#x2014;for example, an offer to sell a * product, rent the DVD of a movie, perform a service, or give away tickets * to an event. Use [[businessFunction]] to indicate the kind of transaction * offered, i.e. sell, lease, etc. This property can also be used to * describe a [[Demand]]. While this property is listed as expected on a * number of common types, it can be used in others. In that case, using a * second type, such as Product or a subtype of Product, can clarify the * nature of the offer. * * @param \Spatie\SchemaOrg\Contracts\DemandContract|\Spatie\SchemaOrg\Contracts\DemandContract[]|\Spatie\SchemaOrg\Contracts\OfferContract|\Spatie\SchemaOrg\Contracts\OfferContract[] $offers * * @return static * * @see path_to_url * @link path_to_url */ public function offers($offers) { return $this->setProperty('offers', $offers); } /** * A pattern that something has, for example 'polka dot', 'striped', * 'Canadian flag'. Values are typically expressed as text, although links * to controlled value schemes are also supported. * * @param \Spatie\SchemaOrg\Contracts\DefinedTermContract|\Spatie\SchemaOrg\Contracts\DefinedTermContract[]|string|string[] $pattern * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function pattern($pattern) { return $this->setProperty('pattern', $pattern); } /** * Provides positive considerations regarding something, for example product * highlights or (alongside [[negativeNotes]]) pro/con lists for reviews. * * In the case of a [[Review]], the property describes the [[itemReviewed]] * from the perspective of the review; in the case of a [[Product]], the * product itself is being described. * * The property values can be expressed either as unstructured text * (repeated as necessary), or if ordered, as a list (in which case the most * positive is at the beginning of the list). * * @param \Spatie\SchemaOrg\Contracts\ItemListContract|\Spatie\SchemaOrg\Contracts\ItemListContract[]|\Spatie\SchemaOrg\Contracts\ListItemContract|\Spatie\SchemaOrg\Contracts\ListItemContract[]|\Spatie\SchemaOrg\Contracts\WebContentContract|\Spatie\SchemaOrg\Contracts\WebContentContract[]|string|string[] $positiveNotes * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function positiveNotes($positiveNotes) { return $this->setProperty('positiveNotes', $positiveNotes); } /** * Indicates a potential Action, which describes an idealized action in * which this thing would play an 'object' role. * * @param \Spatie\SchemaOrg\Contracts\ActionContract|\Spatie\SchemaOrg\Contracts\ActionContract[] $potentialAction * * @return static * * @see path_to_url */ public function potentialAction($potentialAction) { return $this->setProperty('potentialAction', $potentialAction); } /** * The product identifier, such as ISBN. For example: ``` meta * itemprop="productID" content="isbn:123-456-789" ```. * * @param string|string[] $productID * * @return static * * @see path_to_url */ public function productID($productID) { return $this->setProperty('productID', $productID); } /** * The date of production of the item, e.g. vehicle. * * @param \DateTimeInterface|\DateTimeInterface[] $productionDate * * @return static * * @see path_to_url */ public function productionDate($productionDate) { return $this->setProperty('productionDate', $productionDate); } /** * Proprietary name given to the diet plan, typically by its originator or * creator. * * @param string|string[] $proprietaryName * * @return static * * @see path_to_url * @see path_to_url */ public function proprietaryName($proprietaryName) { return $this->setProperty('proprietaryName', $proprietaryName); } /** * The date the item, e.g. vehicle, was purchased by the current owner. * * @param \DateTimeInterface|\DateTimeInterface[] $purchaseDate * * @return static * * @see path_to_url */ public function purchaseDate($purchaseDate) { return $this->setProperty('purchaseDate', $purchaseDate); } /** * If applicable, the organization that officially recognizes this entity as * part of its endorsed system of medicine. * * @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[] $recognizingAuthority * * @return static * * @see path_to_url * @see path_to_url */ public function recognizingAuthority($recognizingAuthority) { return $this->setProperty('recognizingAuthority', $recognizingAuthority); } /** * Recommended intake of this supplement for a given population as defined * by a specific recommending authority. * * @param \Spatie\SchemaOrg\Contracts\RecommendedDoseScheduleContract|\Spatie\SchemaOrg\Contracts\RecommendedDoseScheduleContract[] $recommendedIntake * * @return static * * @see path_to_url * @see path_to_url */ public function recommendedIntake($recommendedIntake) { return $this->setProperty('recommendedIntake', $recommendedIntake); } /** * The release date of a product or product model. This can be used to * distinguish the exact variant of a product. * * @param \DateTimeInterface|\DateTimeInterface[] $releaseDate * * @return static * * @see path_to_url */ public function releaseDate($releaseDate) { return $this->setProperty('releaseDate', $releaseDate); } /** * If applicable, a medical specialty in which this entity is relevant. * * @param \Spatie\SchemaOrg\Contracts\MedicalSpecialtyContract|\Spatie\SchemaOrg\Contracts\MedicalSpecialtyContract[] $relevantSpecialty * * @return static * * @see path_to_url * @see path_to_url */ public function relevantSpecialty($relevantSpecialty) { return $this->setProperty('relevantSpecialty', $relevantSpecialty); } /** * A review of the item. * * @param \Spatie\SchemaOrg\Contracts\ReviewContract|\Spatie\SchemaOrg\Contracts\ReviewContract[] $review * * @return static * * @see path_to_url */ public function review($review) { return $this->setProperty('review', $review); } /** * Review of the item. * * @param \Spatie\SchemaOrg\Contracts\ReviewContract|\Spatie\SchemaOrg\Contracts\ReviewContract[] $reviews * * @return static * * @see path_to_url */ public function reviews($reviews) { return $this->setProperty('reviews', $reviews); } /** * Any potential safety concern associated with the supplement. May include * interactions with other drugs and foods, pregnancy, breastfeeding, known * adverse reactions, and documented efficacy of the supplement. * * @param string|string[] $safetyConsideration * * @return static * * @see path_to_url * @see path_to_url */ public function safetyConsideration($safetyConsideration) { return $this->setProperty('safetyConsideration', $safetyConsideration); } /** * URL of a reference Web page that unambiguously indicates the item's * identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or * official website. * * @param string|string[] $sameAs * * @return static * * @see path_to_url */ public function sameAs($sameAs) { return $this->setProperty('sameAs', $sameAs); } /** * A standardized size of a product or creative work, specified either * through a simple textual string (for example 'XL', '32Wx34L'), a * QuantitativeValue with a unitCode, or a comprehensive and structured * [[SizeSpecification]]; in other cases, the [[width]], [[height]], * [[depth]] and [[weight]] properties may be more applicable. * * @param \Spatie\SchemaOrg\Contracts\DefinedTermContract|\Spatie\SchemaOrg\Contracts\DefinedTermContract[]|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract[]|\Spatie\SchemaOrg\Contracts\SizeSpecificationContract|\Spatie\SchemaOrg\Contracts\SizeSpecificationContract[]|string|string[] $size * * @return static * * @see path_to_url * @see path_to_url * @link path_to_url */ public function size($size) { return $this->setProperty('size', $size); } /** * The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a * product or service, or the product to which the offer refers. * * @param string|string[] $sku * * @return static * * @see path_to_url */ public function sku($sku) { return $this->setProperty('sku', $sku); } /** * A slogan or motto associated with the item. * * @param string|string[] $slogan * * @return static * * @see path_to_url */ public function slogan($slogan) { return $this->setProperty('slogan', $slogan); } /** * A medical study or trial related to this entity. * * @param \Spatie\SchemaOrg\Contracts\MedicalStudyContract|\Spatie\SchemaOrg\Contracts\MedicalStudyContract[] $study * * @return static * * @see path_to_url * @see path_to_url */ public function study($study) { return $this->setProperty('study', $study); } /** * A CreativeWork or Event about this Thing. * * @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|\Spatie\SchemaOrg\Contracts\EventContract|\Spatie\SchemaOrg\Contracts\EventContract[] $subjectOf * * @return static * * @see path_to_url * @link path_to_url */ public function subjectOf($subjectOf) { return $this->setProperty('subjectOf', $subjectOf); } /** * Characteristics of the population for which this is intended, or which * typically uses it, e.g. 'adults'. * * @param string|string[] $targetPopulation * * @return static * * @see path_to_url * @see path_to_url */ public function targetPopulation($targetPopulation) { return $this->setProperty('targetPopulation', $targetPopulation); } /** * URL of the item. * * @param string|string[] $url * * @return static * * @see path_to_url */ public function url($url) { return $this->setProperty('url', $url); } /** * The weight of the product or person. * * @param \Spatie\SchemaOrg\Contracts\QuantitativeValueContract|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract[] $weight * * @return static * * @see path_to_url */ public function weight($weight) { return $this->setProperty('weight', $weight); } /** * The width of the item. * * @param \Spatie\SchemaOrg\Contracts\DistanceContract|\Spatie\SchemaOrg\Contracts\DistanceContract[]|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract|\Spatie\SchemaOrg\Contracts\QuantitativeValueContract[] $width * * @return static * * @see path_to_url */ public function width($width) { return $this->setProperty('width', $width); } } ```
The 2017 Virsligas Winter Cup is the league cup's fifth season. It began on 14 January 2017. FK Liepāja are the defending champion. Group stage References Virsligas Winter Cup Virsligas Winter Cup
The Takitimu Mountains extend in a north–south direction southeast of Te Anau and Manapouri. The mountain range is about long and contains several peaks of around height, with the Brunel Peaks reaching . In Māori people mythology, the mountain range is special to Ngāi Tahu as it represents the upturned hull of the Tākitimu waka wrecked in Te Waewae Bay to the south of the Takitimu Mountains. References Mountain ranges of Southland, New Zealand
```xml <?xml version="1.0" encoding="utf-8"?> <set android:duration="300" android:shareInterpolator="true" android:interpolator="@android:anim/accelerate_decelerate_interpolator" xmlns:android="path_to_url"> <translate android:fromYDelta="10%" android:toYDelta="0" android:fillBefore="true" android:fillAfter="true"/> <alpha android:fromAlpha="0" android:toAlpha="1" android:fillBefore="true" android:fillAfter="true"/> </set> ```
```javascript /** * * You are hereby granted a non-exclusive, worldwide, royalty-free license to * use, copy, modify, and distribute this software in source code or binary * form for use in connection with the web services and APIs provided by * Facebook. * * As with any software that integrates with the Facebook platform, your use * of this software is subject to the Facebook Developer Principles and * Policies [path_to_url This copyright notice * shall be included in all copies or substantial portions of the software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE */ 'use strict'; module.exports = store => next => action => Array.isArray(action) ? action.map(next) : next(action); ```
Sthandiwe Kgoroge (born Sithandiwe Msomi; 4 February 1972) is a South Africa actor who appeared in Generations, series 5 and 7 of MTV Shuga, the mini-series MTV Shuga Alone Together, and the first series of Yizo Yizo. Life Kgoroge lived in Edmonton, Canada, from age five to ten. She was educated at the University of Natal, where she graduated in drama. She has said that she struggled with her self image, but eventually realised that her dark complexion was exactly right. She appeared in the first series of Yizo Yizo as Zoe Cele in 1999. She was recognised as the best supporting actress in a drama series for this role, and she received an Avanti Award. She played twins in Generations from 1999 to 2005. She appeared in series 5 of MTV Shuga as Aunt Nomalenga and returned to the role for the mini-series MTV Shuga Alone Together, which highlighted the problems of the COVID-19 pandemic, on 20 April 2020. During the series the characters talk to each other about life during the lockdown. The mini-series is scheduled for 60 nights and its backers include the "Every Woman Every Child". The series is based in Nigeria, South Africa, Kenya and Cote D’Ivoire. All of the filming is done by the actors themselves, who include Lerato Walaza, Mamarumo Marokane and Mohau Cele. Private life Sthandiwe also known as "Sta" is married to actor Tony Kgoroge, and they have children. When faced with debt recovery in 2018, he asked that people ignore his and his wife's Instagram pages, saying they were only "ordinary citizens". He was facing a loss of earnings because he was not being paid for repeat fees by some broadcasters. Sta loves her church family and serves the Lord. Fashion career Sthandiwe has been said to be "always ahead of the curve, she’s been recycling and upcycling secondhand and vintage clothes for many years. Her love of clothes with a strong story line led her to starting The Vintage Market. In collaboration with about twenty other vintage lovers, she offers a wide range of clothes, all in good condition for independent-minded fashion lovers and keeping these clothes out of the landfills".""The one thing they (my children) have taught me is that I am great... and that I am hilarious. They think I'm so cool. When I drop them off at school, in my Simon and Mary hats and clothes that I have designed, they want me to come and greet their friends," she said." In 2008 Five Roses sponsored "the designs of Mantsho (Palesa Mokubung); Hermanna Rush (Nicole Dersley and Jacqueline Corfield) and Miss Scarlet (Jacky Lucking). Designers were also commissioned to design dresses for well-known celebrities, including Sthandiwe Kgoroge. References Living people South African television actresses University of Natal alumni 1972 births 20th-century South African actresses
Acholeplasma are wall-less bacteria in the Mollicutes class. They include saprotrophic or pathogenic species. There are 15 recognised species. The G+C content is low, ranging from 26 - 36% (mol%). The genomes of Acholeplasma species range in size from 1.5 to 1.65 Mbp. Cholesterol is not required for growth. The species are found on animals, and some plants and insects. The optimum growth temperature is 30 to 37 degrees Celsius. Acholeplasma laidlawii is a common contaminant of cell culture media products, and has also been used in extensive studies of lipid polymorphism because this organism alters its ratio of MGlcDG (monoglucosyl diacylglycerol) to DGlcDG (diglucosyl diacylglycerol) in response to growth conditions. Phylogeny See also List of bacteria genera List of bacterial orders References Mollicutes Cryozoa Bacteria genera
```python # # # path_to_url # # Unless required by applicable law or agreed to in writing, software # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # ============================================================================== """Context for Universal Value Function agents. A context specifies a list of contextual variables, each with own sampling and reward computation methods. Examples of contextual variables include goal states, reward combination vectors, etc. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from tf_agents import specs import gin.tf from utils import utils as uvf_utils @gin.configurable class Context(object): """Base context.""" VAR_NAME = 'action' def __init__(self, tf_env, context_ranges=None, context_shapes=None, state_indices=None, variable_indices=None, gamma_index=None, settable_context=False, timers=None, samplers=None, reward_weights=None, reward_fn=None, random_sampler_mode='random', normalizers=None, context_transition_fn=None, context_multi_transition_fn=None, meta_action_every_n=None): self._tf_env = tf_env self.variable_indices = variable_indices self.gamma_index = gamma_index self._settable_context = settable_context self.timers = timers self._context_transition_fn = context_transition_fn self._context_multi_transition_fn = context_multi_transition_fn self._random_sampler_mode = random_sampler_mode # assign specs self._obs_spec = self._tf_env.observation_spec() self._context_shapes = tuple([ shape if shape is not None else self._obs_spec.shape for shape in context_shapes ]) self.context_specs = tuple([ specs.TensorSpec(dtype=self._obs_spec.dtype, shape=shape) for shape in self._context_shapes ]) if context_ranges is not None: self.context_ranges = context_ranges else: self.context_ranges = [None] * len(self._context_shapes) self.context_as_action_specs = tuple([ specs.BoundedTensorSpec( shape=shape, dtype=(tf.float32 if self._obs_spec.dtype in [tf.float32, tf.float64] else self._obs_spec.dtype), minimum=context_range[0], maximum=context_range[-1]) for shape, context_range in zip(self._context_shapes, self.context_ranges) ]) if state_indices is not None: self.state_indices = state_indices else: self.state_indices = [None] * len(self._context_shapes) if self.variable_indices is not None and self.n != len( self.variable_indices): raise ValueError( 'variable_indices (%s) must have the same length as contexts (%s).' % (self.variable_indices, self.context_specs)) assert self.n == len(self.context_ranges) assert self.n == len(self.state_indices) # assign reward/sampler fns self._sampler_fns = dict() self._samplers = dict() self._reward_fns = dict() # assign reward fns self._add_custom_reward_fns() reward_weights = reward_weights or None self._reward_fn = self._make_reward_fn(reward_fn, reward_weights) # assign samplers self._add_custom_sampler_fns() for mode, sampler_fns in samplers.items(): self._make_sampler_fn(sampler_fns, mode) # create normalizers if normalizers is None: self._normalizers = [None] * len(self.context_specs) else: self._normalizers = [ normalizer(tf.zeros(shape=spec.shape, dtype=spec.dtype)) if normalizer is not None else None for normalizer, spec in zip(normalizers, self.context_specs) ] assert self.n == len(self._normalizers) self.meta_action_every_n = meta_action_every_n # create vars self.context_vars = {} self.timer_vars = {} self.create_vars(self.VAR_NAME) self.t = tf.Variable( tf.zeros(shape=(), dtype=tf.int32), name='num_timer_steps') def _add_custom_reward_fns(self): pass def _add_custom_sampler_fns(self): pass def sample_random_contexts(self, batch_size): """Sample random batch contexts.""" assert self._random_sampler_mode is not None return self.sample_contexts(self._random_sampler_mode, batch_size)[0] def sample_contexts(self, mode, batch_size, state=None, next_state=None, **kwargs): """Sample a batch of contexts. Args: mode: A string representing the mode [`train`, `explore`, `eval`]. batch_size: Batch size. Returns: Two lists of [batch_size, num_context_dims] contexts. """ contexts, next_contexts = self._sampler_fns[mode]( batch_size, state=state, next_state=next_state, **kwargs) self._validate_contexts(contexts) self._validate_contexts(next_contexts) return contexts, next_contexts def compute_rewards(self, mode, states, actions, rewards, next_states, contexts): """Compute context-based rewards. Args: mode: A string representing the mode ['uvf', 'task']. states: A [batch_size, num_state_dims] tensor. actions: A [batch_size, num_action_dims] tensor. rewards: A [batch_size] tensor representing unmodified rewards. next_states: A [batch_size, num_state_dims] tensor. contexts: A list of [batch_size, num_context_dims] tensors. Returns: A [batch_size] tensor representing rewards. """ return self._reward_fn(states, actions, rewards, next_states, contexts) def _make_reward_fn(self, reward_fns_list, reward_weights): """Returns a fn that computes rewards. Args: reward_fns_list: A fn or a list of reward fns. mode: A string representing the operating mode. reward_weights: A list of reward weights. """ if not isinstance(reward_fns_list, (list, tuple)): reward_fns_list = [reward_fns_list] if reward_weights is None: reward_weights = [1.0] * len(reward_fns_list) assert len(reward_fns_list) == len(reward_weights) reward_fns_list = [ self._custom_reward_fns[fn] if isinstance(fn, (str,)) else fn for fn in reward_fns_list ] def reward_fn(*args, **kwargs): """Returns rewards, discounts.""" reward_tuples = [ reward_fn(*args, **kwargs) for reward_fn in reward_fns_list ] rewards_list = [reward_tuple[0] for reward_tuple in reward_tuples] discounts_list = [reward_tuple[1] for reward_tuple in reward_tuples] ndims = max([r.shape.ndims for r in rewards_list]) if ndims > 1: # expand reward shapes to allow broadcasting for i in range(len(rewards_list)): for _ in range(rewards_list[i].shape.ndims - ndims): rewards_list[i] = tf.expand_dims(rewards_list[i], axis=-1) for _ in range(discounts_list[i].shape.ndims - ndims): discounts_list[i] = tf.expand_dims(discounts_list[i], axis=-1) rewards = tf.add_n( [r * tf.to_float(w) for r, w in zip(rewards_list, reward_weights)]) discounts = discounts_list[0] for d in discounts_list[1:]: discounts *= d return rewards, discounts return reward_fn def _make_sampler_fn(self, sampler_cls_list, mode): """Returns a fn that samples a list of context vars. Args: sampler_cls_list: A list of sampler classes. mode: A string representing the operating mode. """ if not isinstance(sampler_cls_list, (list, tuple)): sampler_cls_list = [sampler_cls_list] self._samplers[mode] = [] sampler_fns = [] for spec, sampler in zip(self.context_specs, sampler_cls_list): if isinstance(sampler, (str,)): sampler_fn = self._custom_sampler_fns[sampler] else: sampler_fn = sampler(context_spec=spec) self._samplers[mode].append(sampler_fn) sampler_fns.append(sampler_fn) def batch_sampler_fn(batch_size, state=None, next_state=None, **kwargs): """Sampler fn.""" contexts_tuples = [ sampler(batch_size, state=state, next_state=next_state, **kwargs) for sampler in sampler_fns] contexts = [c[0] for c in contexts_tuples] next_contexts = [c[1] for c in contexts_tuples] contexts = [ normalizer.update_apply(c) if normalizer is not None else c for normalizer, c in zip(self._normalizers, contexts) ] next_contexts = [ normalizer.apply(c) if normalizer is not None else c for normalizer, c in zip(self._normalizers, next_contexts) ] return contexts, next_contexts self._sampler_fns[mode] = batch_sampler_fn def set_env_context_op(self, context, disable_unnormalizer=False): """Returns a TensorFlow op that sets the environment context. Args: context: A list of context Tensor variables. disable_unnormalizer: Disable unnormalization. Returns: A TensorFlow op that sets the environment context. """ ret_val = np.array(1.0, dtype=np.float32) if not self._settable_context: return tf.identity(ret_val) if not disable_unnormalizer: context = [ normalizer.unapply(tf.expand_dims(c, 0))[0] if normalizer is not None else c for normalizer, c in zip(self._normalizers, context) ] def set_context_func(*env_context_values): tf.logging.info('[set_env_context_op] Setting gym environment context.') # pylint: disable=protected-access self.gym_env.set_context(*env_context_values) return ret_val # pylint: enable=protected-access with tf.name_scope('set_env_context'): set_op = tf.py_func(set_context_func, context, tf.float32, name='set_env_context_py_func') set_op.set_shape([]) return set_op def set_replay(self, replay): """Set replay buffer for samplers. Args: replay: A replay buffer. """ for _, samplers in self._samplers.items(): for sampler in samplers: sampler.set_replay(replay) def get_clip_fns(self): """Returns a list of clip fns for contexts. Returns: A list of fns that clip context tensors. """ clip_fns = [] for context_range in self.context_ranges: def clip_fn(var_, range_=context_range): """Clip a tensor.""" if range_ is None: clipped_var = tf.identity(var_) elif isinstance(range_[0], (int, long, float, list, np.ndarray)): clipped_var = tf.clip_by_value( var_, range_[0], range_[1],) else: raise NotImplementedError(range_) return clipped_var clip_fns.append(clip_fn) return clip_fns def _validate_contexts(self, contexts): """Validate if contexts have right specs. Args: contexts: A list of [batch_size, num_context_dim] tensors. Raises: ValueError: If shape or dtype mismatches that of spec. """ for i, (context, spec) in enumerate(zip(contexts, self.context_specs)): if context[0].shape != spec.shape: raise ValueError('contexts[%d] has invalid shape %s wrt spec shape %s' % (i, context[0].shape, spec.shape)) if context.dtype != spec.dtype: raise ValueError('contexts[%d] has invalid dtype %s wrt spec dtype %s' % (i, context.dtype, spec.dtype)) def context_multi_transition_fn(self, contexts, **kwargs): """Returns multiple future contexts starting from a batch.""" assert self._context_multi_transition_fn return self._context_multi_transition_fn(contexts, None, None, **kwargs) def step(self, mode, agent=None, action_fn=None, **kwargs): """Returns [next_contexts..., next_timer] list of ops. Args: mode: a string representing the mode=[train, explore, eval]. **kwargs: kwargs for context_transition_fn. Returns: a list of ops that set the context. """ if agent is None: ops = [] if self._context_transition_fn is not None: def sampler_fn(): samples = self.sample_contexts(mode, 1)[0] return [s[0] for s in samples] values = self._context_transition_fn(self.vars, self.t, sampler_fn, **kwargs) ops += [tf.assign(var, value) for var, value in zip(self.vars, values)] ops.append(tf.assign_add(self.t, 1)) # increment timer return ops else: ops = agent.tf_context.step(mode, **kwargs) state = kwargs['state'] next_state = kwargs['next_state'] state_repr = kwargs['state_repr'] next_state_repr = kwargs['next_state_repr'] with tf.control_dependencies(ops): # Step high level context before computing low level one. # Get the context transition function output. values = self._context_transition_fn(self.vars, self.t, None, state=state_repr, next_state=next_state_repr) # Select a new goal every C steps, otherwise use context transition. low_level_context = [ tf.cond(tf.equal(self.t % self.meta_action_every_n, 0), lambda: tf.cast(action_fn(next_state, context=None), tf.float32), lambda: values)] ops = [tf.assign(var, value) for var, value in zip(self.vars, low_level_context)] with tf.control_dependencies(ops): return [tf.assign_add(self.t, 1)] # increment timer return ops def reset(self, mode, agent=None, action_fn=None, state=None): """Returns ops that reset the context. Args: mode: a string representing the mode=[train, explore, eval]. Returns: a list of ops that reset the context. """ if agent is None: values = self.sample_contexts(mode=mode, batch_size=1)[0] if values is None: return [] values = [value[0] for value in values] values[0] = uvf_utils.tf_print( values[0], values, message='context:reset, mode=%s' % mode, first_n=10, name='context:reset:%s' % mode) all_ops = [] for _, context_vars in sorted(self.context_vars.items()): ops = [tf.assign(var, value) for var, value in zip(context_vars, values)] all_ops += ops all_ops.append(self.set_env_context_op(values)) all_ops.append(tf.assign(self.t, 0)) # reset timer return all_ops else: ops = agent.tf_context.reset(mode) # NOTE: The code is currently written in such a way that the higher level # policy does not provide a low-level context until the second # observation. Insead, we just zero-out low-level contexts. for key, context_vars in sorted(self.context_vars.items()): ops += [tf.assign(var, tf.zeros_like(var)) for var, meta_var in zip(context_vars, agent.tf_context.context_vars[key])] ops.append(tf.assign(self.t, 0)) # reset timer return ops def create_vars(self, name, agent=None): """Create tf variables for contexts. Args: name: Name of the variables. Returns: A list of [num_context_dims] tensors. """ if agent is not None: meta_vars = agent.create_vars(name) else: meta_vars = {} assert name not in self.context_vars, ('Conflict! %s is already ' 'initialized.') % name self.context_vars[name] = tuple([ tf.Variable( tf.zeros(shape=spec.shape, dtype=spec.dtype), name='%s_context_%d' % (name, i)) for i, spec in enumerate(self.context_specs) ]) return self.context_vars[name], meta_vars @property def n(self): return len(self.context_specs) @property def vars(self): return self.context_vars[self.VAR_NAME] # pylint: disable=protected-access @property def gym_env(self): return self._tf_env.pyenv._gym_env @property def tf_env(self): return self._tf_env # pylint: enable=protected-access ```
The Savill Garden is an enclosed part of Windsor Great Park in England, created by Sir Eric Savill in the 1930s. It is managed by the Crown Estate and charges an entrance fee. The garden includes woodland, ornamental areas and a pond. The attractions include the New Zealand Garden, the Queen Elizabeth Temperate House and trees planted by members of the Royal Family. In June 2010, a new contemporary rose garden designed by Andrew Wilson and Gavin McWilliam of Wilson McWilliam Studio was opened by Queen Elizabeth II. Eric Savill (1895–1980) was the grandson of Alfred Savill the founder of a large firm of estate agents and was involved in managing Windsor Great Park from 1930 to 1970, being Director of Gardens from 1962 to 1970. He opened the Savill Garden to the public in 1951 and left it as a heritage to the nation. In June 2006, a specially designed new visitor centre, the Savill Building by Glenn Howells Architects was opened. The timber for the floor and roof came from the Windsor Estate. The Savill Garden and the nearby Valley Gardens are Grade I listed on the Register of Historic Parks and Gardens. References External links Grade I listed parks and gardens in Surrey Windsor Great Park
```python # # # path_to_url # # Unless required by applicable law or agreed to in writing, software # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. import inspect import warnings from functools import reduce import numpy as np import paddle from paddle.base import core, unique_name from paddle.base.data_feeder import check_dtype from paddle.base.framework import ( Program, Variable, default_main_program, in_dygraph_mode, in_dynamic_or_pir_mode, in_pir_mode, name_scope, program_guard, static_only, ) from paddle.base.param_attr import ParamAttr from paddle.base.wrapped_decorator import signature_safe_contextmanager from paddle.common_ops_import import ( LayerHelper, check_type, check_variable_and_dtype, ) from paddle.nn.initializer import Constant, Normal __all__ = [] @static_only def fc( x, size, num_flatten_dims=1, weight_attr=None, bias_attr=None, activation=None, name=None, ): r""" Fully-Connected layer can take a tensor or a list of tensor as its inputs. It creates a 2-D weight tensor for each input tensor, which represents its weight matrix from each input unit to each output unit. The fully connected layer multiplies each input tensor with its corresponding weight to produce an output tensor with shape :math:`[batch\_size, *, size]` , where :math:`*` means any number of additional dimensions. If a list of tensor is given, the results of multiple output tensors with shape :math:`[batch\_size, *, size]` will be summed up. If :attr:`bias_attr` is not False, a 1-D bias tensor will be created and added to the output. Finally, if :attr:`activation` is not None, it will be applied to the output as well. For a single input tensor :math:`X` , the equation is: .. math:: Out = Act({XW + b}) For a list of input tensor, the equation is: .. math:: Out = Act({\sum_{i=0}^{N-1}X_iW_i + b}) where: * :math:`N`: The number of the input tensors. :math:`N` equals to :math:`len(X)` if :math:`X` is list of tensor. * :math:`X_i`: The i-th input tensor. * :math:`W_i`: The i-th weight matrix corresponding i-th input tensor. * :math:`b`: The bias created by this layer (if needed). * :math:`Act`: The activation function. * :math:`Out`: The output tensor. .. code-block:: text # Case 1, input is a single tensor: x.data = [[[0.1, 0.2], [0.3, 0.4]]] x.shape = (1, 2, 2) # 1 is batch_size out = paddle.static.nn.fc(x=x, size=1, num_flatten_dims=2) # Get the output: out.data = [[0.83234344], [0.34936576]] out.shape = (1, 2, 1) # Case 2, input is a list of tensor: x0.data = [[[0.1, 0.2], [0.3, 0.4]]] x0.shape = (1, 2, 2) # 1 is batch_size x1.data = [[[0.1, 0.2, 0.3]]] x1.shape = (1, 1, 3) out = paddle.static.nn.fc(x=[x0, x1], size=2) # Get the output: out.data = [[0.18669507, 0.1893476]] out.shape = (1, 2) Args: x (Tensor|list[Tensor]|tuple[Tensor]): A tensor or a list/tuple of tensors. The number of dimensions of each tensor is at least 2. The data type should be float16, float32 or float64. size (int): The number of output units in this layer, which also means the feature size of output tensor. num_flatten_dims (int, optional): The fc layer can accept an input tensor with more than two dimensions. If this happens, the multi-dimensional tensor will first be flattened into a 2-D matrix. The parameter :attr:`num_flatten_dims` determines how the input tensor is flattened: the first :math:`num\_flatten\_dims` (inclusive, index starts from 1) dimensions will be flatten to form the first dimension of the final matrix (height of the matrix), and the rest :math:`rank(x) - num\_flatten\_dims` dimensions are flattened to form the second dimension of the final matrix (width of the matrix). For example, assuming that :attr:`x` is a 5-dimensional tensor with a shape :math:`[2, 3, 4, 5, 6]` , and :attr:`num_flatten_dims` = 3. Then, the flattened matrix will have a shape :math:`[2 * 3 * 4, 5 * 6] = [24, 30]` . Default: 1. weight_attr (ParamAttr, optional): The attribute for the learnable weight. The default value is None, and the weight will be initialized to zero. For detailed information, please refer to :attr:`paddle.ParamAttr`. Warning, if x is a list of tensor, weight_attr should also be a list of same length. bias_attr (ParamAttr|bool, optional): The attribute of the learnable bias. If it is set to False, no bias will be added to the output. If it is set to None or one kind of ParamAttr, a bias parameter will be created according to ParamAttr. For detailed information, please refer to :attr:`paddle.ParamAttr`. The default value is None and the bias will be initialized to zero. activation (str, optional): Activation to be applied to the output of this layer, such as tanh, softmax, sigmoid, relu. For more information, please refer to :ref:`api_guide_activations_en` . Default: None. name (str, optional): The default value is None. Normally there is no need for user to set it. For more information, please refer to :ref:`api_guide_Name` . Returns: Tensor, its shape is :math:`[batch\_size, *, size]` , and the data type is same with input. Examples: .. code-block:: python >>> import paddle >>> paddle.enable_static() >>> # When input is a single tensor >>> x = paddle.static.data(name="x", shape=[1, 2, 2], dtype="float32") >>> out = paddle.static.nn.fc( ... x=x, ... size=1, ... num_flatten_dims=2, ... weight_attr=paddle.ParamAttr(initializer=paddle.nn.initializer.Constant(value=0.5)), ... bias_attr=paddle.ParamAttr(initializer=paddle.nn.initializer.Constant(value=1.0))) >>> print(out) var fc_0.tmp_1 : LOD_TENSOR.shape(1, 2, 1).dtype(float32).stop_gradient(False) >>> # When input is multiple tensors >>> x0 = paddle.static.data(name="x0", shape=[1, 2, 2], dtype="float32") >>> x1 = paddle.static.data(name="x1", shape=[1, 1, 3], dtype="float32") >>> out = paddle.static.nn.fc( ... x=[x0, x1], ... size=2, ... weight_attr=paddle.ParamAttr(initializer=paddle.nn.initializer.Constant(value=0.5)), ... bias_attr=paddle.ParamAttr(initializer=paddle.nn.initializer.Constant(value=1.0))) >>> print(out) var fc_1.tmp_3 : LOD_TENSOR.shape(1, 2).dtype(float32).stop_gradient(False) """ def fc_base( input, size, num_flatten_dims=1, param_attr=None, bias_attr=None, act=None, name=None, ): helper = LayerHelper("fc", **locals()) check_type( input, 'input', (list, tuple, Variable, paddle.pir.Value), 'fc' ) if isinstance(input, (list, tuple)): for i, input_x in enumerate(input): check_type( input_x, 'input[' + str(i) + ']', (Variable, paddle.pir.Value), 'fc', ) dtype = helper.input_dtype() check_dtype( dtype, 'input', ['float16', 'uint16', 'float32', 'float64'], 'fc' ) mul_results = [] for input_var, param_attr in helper.iter_inputs_and_params(): input_shape = input_var.shape if num_flatten_dims == -1: num_flatten_dims = len(input_shape) - 1 param_shape = [ reduce(lambda a, b: a * b, input_shape[num_flatten_dims:], 1), size, ] w = helper.create_parameter( attr=param_attr, shape=param_shape, dtype=dtype, is_bias=False ) if in_pir_mode(): if len(input_var.shape) > 2: new_shape = ( input_var.shape[0], np.prod(input_var.shape[1:]), ) input_var = paddle.reshape(input_var, new_shape) tmp = paddle.matmul(input_var, w) else: tmp = helper.create_variable_for_type_inference(dtype) helper.append_op( type="mul", inputs={"X": input_var, "Y": w}, outputs={"Out": tmp}, attrs={ "x_num_col_dims": num_flatten_dims, "y_num_col_dims": 1, }, ) mul_results.append(tmp) if len(mul_results) == 1: pre_bias = mul_results[0] elif in_pir_mode(): pre_bias = paddle.add_n(mul_results) else: pre_bias = helper.create_variable_for_type_inference(dtype) helper.append_op( type="sum", inputs={"X": mul_results}, outputs={"Out": pre_bias}, attrs={}, ) # add bias pre_activation = helper.append_bias_op( pre_bias, dim_start=num_flatten_dims ) # add activation return helper.append_activation(pre_activation) return fc_base( input=x, size=size, num_flatten_dims=num_flatten_dims, param_attr=weight_attr, bias_attr=bias_attr, act=activation, name=name, ) def instance_norm( input, epsilon=1e-05, param_attr=None, bias_attr=None, name=None ): r""" **Instance Normalization Layer** Can be used as a normalizer function for convolution or fully_connected operations. The required data format for this layer is one of the following: DataLayout: NCHW `[batch, in_channels, in_height, in_width]` Refer to `Instance Normalization: The Missing Ingredient for Fast Stylization <path_to_url`_ for more details. :math:`input` is the input features over a mini-batch. .. math:: \mu_{\beta} &\gets \frac{1}{HW} \sum_{i=1}^{HW} x_i \qquad &// \ mean\ of\ one\ feature\ map\ in\ mini-batch \\ \sigma_{\beta}^{2} &\gets \frac{1}{HW} \sum_{i=1}^{HW}(x_i - \mu_{\beta})^2 \qquad &//\ variance\ of\ one\ feature\ map\ in\ mini-batch \\ \hat{x_i} &\gets \frac{x_i - \mu_\beta} {\sqrt{ \sigma_{\beta}^{2} + \epsilon}} \qquad &//\ normalize \\ y_i &\gets \gamma \hat{x_i} + \beta \qquad &//\ scale\ and\ shift Note: `H` means height of feature map, `W` means width of feature map. Args: input(Tensor): The rank of input tensor can be 2, 3, 4, 5. The data type is float32 or float64. epsilon(float, Default 1e-05): A value added to the denominator for numerical stability. Default is 1e-5. param_attr(ParamAttr|None|bool, optional): The parameter attribute for Parameter `scale` of instance_norm. If it is set to None or one attribute of ParamAttr, instance_norm will create ParamAttr as param_attr, the name of scale can be set in ParamAttr. If the Initializer of the param_attr is not set, the parameter is initialized with Xavier. If the param_attr is set to False, instance_norm will not create param_attr. Default: None. bias_attr(ParamAttr|None|bool, optional): The parameter attribute for the bias of instance_norm. If it is set to None or one attribute of ParamAttr, instance_norm will create ParamAttr as bias_attr, the name of bias can be set in ParamAttr. If the Initializer of the bias_attr is not set, the bias is initialized zero. If the bias_attr is set to False, instance_norm will not create bias_attr. Default: None. name(string, Default None): A name for this layer(optional). If set None, the layer will be named automatically. Returns: A Tensor which is the result after applying instance normalization on the input, has same shape and data type with input. Examples: .. code-block:: python >>> import paddle >>> paddle.enable_static() >>> x = paddle.static.data(name='x', shape=[3, 7, 3, 7], dtype='float32') >>> hidden1 = paddle.static.nn.fc(x, size=200) >>> hidden2 = paddle.static.nn.instance_norm(hidden1) """ check_variable_and_dtype( input, 'input', ['uint16', 'float16', 'float32', 'float64'], 'instance_norm', ) if param_attr is False: assert ( bias_attr is False ), "param_attr and bias_attr must be set to False at the same time in instance_norm" helper = LayerHelper('instance_norm', **locals()) dtype = helper.input_dtype() # use fp32 for in parameter if dtype == paddle.float16: dtype = paddle.float32 input_shape = input.shape if len(input.shape) < 2 or len(input.shape) > 5: raise ValueError( f'expected 2D or 3D or 4D or 5D input (got {len(input.shape)}D input, input shape is: {input_shape})' ) channel_num = input_shape[1] param_shape = [channel_num] if param_attr and bias_attr: # create parameter scale = helper.create_parameter( attr=helper.param_attr, shape=param_shape, dtype=dtype, default_initializer=Constant(1.0), ) bias = helper.create_parameter( attr=helper.bias_attr, shape=param_shape, dtype=dtype, is_bias=True, default_initializer=Constant(0.0), ) # create output saved_mean = helper.create_variable_for_type_inference( dtype=dtype, stop_gradient=True ) saved_variance = helper.create_variable_for_type_inference( dtype=dtype, stop_gradient=True ) instance_norm_out = helper.create_variable_for_type_inference(dtype) inputs = {"X": input} if param_attr and bias_attr: inputs["Scale"] = scale inputs["Bias"] = bias helper.append_op( type="instance_norm", inputs=inputs, outputs={ "Y": instance_norm_out, "SavedMean": saved_mean, "SavedVariance": saved_variance, }, attrs={ "epsilon": epsilon, }, ) return instance_norm_out @static_only def continuous_value_model(input, cvm, use_cvm=True): r""" **continuous_value_model layers** Now, this OP is used in CTR project to remove or dispose show and click value in :attr:`input`. :attr:`input` is an embedding vector including show and click value, whose shape is :math:`[N, D]` (N is batch size. D is `2 + embedding dim` ). Show and click at first two dims of embedding vector D. If :attr:`use_cvm` is True, it will calculate :math:`log(show)` and :math:`log(click)` , and output shape is :math:`[N, D]` . If :attr:`use_cvm` is False, it will remove show and click from :attr:`input` , and output shape is :math:`[N, D - 2]` . :attr:`cvm` is show_click info, whose shape is :math:`[N, 2]` . Args: input (Variable): The input variable. A 2-D LoDTensor with shape :math:`[N, D]` , where N is the batch size, D is `2 + the embedding dim` . `lod level = 1` . A Tensor with type float32, float64. cvm (Variable): Show and click variable. A 2-D Tensor with shape :math:`[N, 2]` , where N is the batch size, 2 is show and click. A Tensor with type float32, float64. use_cvm (bool): Use show_click or not. if use, the output dim is the same as input. if not use, the output dim is `input dim - 2` (remove show and click) Returns: Variable: A 2-D LodTensor with shape :math:`[N, M]` . if :attr:`use_cvm` = True, M is equal to input dim D. if False, M is equal to `D - 2`. \ A Tensor with same type as input. Examples: .. code-block:: python >>> import paddle >>> paddle.enable_static() >>> input = paddle.static.data(name="input", shape=[64, 1], dtype="int64") >>> label = paddle.static.data(name="label", shape=[64, 1], dtype="int64") >>> w0 = paddle.full(shape=(100, 1), fill_value=2).astype(paddle.float32) >>> embed = paddle.nn.functional.embedding(input, w0) >>> ones = paddle.full_like(label, 1, dtype="int64") >>> show_clk = paddle.cast(paddle.concat([ones, label], axis=1), dtype='float32') >>> show_clk.stop_gradient = True >>> input_with_cvm = paddle.static.nn.continuous_value_model(embed[:, 0], show_clk, True) """ helper = LayerHelper('cvm', **locals()) out = helper.create_variable(dtype=input.dtype) check_variable_and_dtype( input, 'input', ['float16', 'float32', 'float64'], 'cvm' ) helper.append_op( type='cvm', inputs={'X': [input], 'CVM': [cvm]}, outputs={'Y': [out]}, attrs={"use_cvm": use_cvm}, ) return out @static_only def data_norm( input, act=None, epsilon=1e-05, param_attr=None, data_layout='NCHW', in_place=False, name=None, moving_mean_name=None, moving_variance_name=None, do_model_average_for_mean_and_var=True, slot_dim=-1, sync_stats=False, summary_decay_rate=0.9999999, enable_scale_and_shift=False, ): r""" **Data Normalization Layer** This op can be used as a normalizer function for conv2d and fully_connected operations. The required data format for this layer is one of the following: 1. NHWC `[batch, in_height, in_width, in_channels]` 2. NCHW `[batch, in_channels, in_height, in_width]` :math:`input` is the input features over a mini-batch. .. math:: \mu_{\beta} &\gets \frac{1}{m} \sum_{i=1}^{m} x_i \qquad &// \ mini-batch\ mean \\ \sigma_{\beta}^{2} &\gets \frac{1}{m} \sum_{i=1}^{m}(x_i - \mu_{\beta})^2 \qquad &//\ mini-batch\ variance \\ \hat{x_i} &\gets \frac{x_i - \mu_\beta} {\sqrt{ \sigma_{\beta}^{2} + \epsilon}} \qquad &//\ normalize \\ y_i &\gets \gamma \hat{x_i} + \beta \qquad &//\ scale\ and\ shift Args: input (Tensor): The input Tensor. act (str, optional): Activation type, linear|relu|prelu|... Default: None. epsilon(float, optional): Whether to add small values into the variance during calculations to prevent division by zero. Default: 1e-05. param_attr (ParamAttr, optional): The parameter attribute for Parameter `scale`. Default: None. data_layout (str, optional): Specify the data format of the input, and the data format of the output will be consistent with that of the input. An optional string from: `"NCHW"`, `"NHWC"`. The default is `"NCHW"`. When it is `"NCHW"`, the data is stored in the order of: `[batch_size, input_channels, input_height, input_width]`. Default: `"NCHW"`. in_place (bool, optional): Make the input and output of batch norm reuse memory. Default: False. name (str, optional): A name for this layer (optional). If set None, the layer will be named automatically. Default: None. moving_mean_name (str, optional): The name of moving_mean which store the global Mean. Default: None. moving_variance_name (str, optional): The name of the moving_variance which store the global Variance. Default: None. do_model_average_for_mean_and_var (bool, optional): Whether parameter mean and variance should do model average when model average is enabled. Default: True. slot_dim (int, optional): The embedding dimension of one slot. Slot is a set of one specific feature. In pslib mode, we distinguish feature ids by slot and pull their embeddings from parameter server (pslib). The first place of the embedding is the historical show number (occurrence time of this feature id with a label 0). If the input of this op is concated by slot-wise embeddings, and the show number is zero when this slot is new or empty, the normalization result may be impractical. To avoid this, we add slot_dim to locate the show number and judge if the show number is zero. If so, we choose to skip normalization on this embedding. Default: -1. sync_stats (bool, optional): When running with multiple GPU cards, using allreduce to sync the summary messages. Default: False. summary_decay_rate (float, optional): The decay rate when updating summary. Default: 0.9999999. enable_scale_and_shift (bool, optional): do scale&shift after normalization. Default: False. Returns: Tensor: A tensor which is the result after applying data normalization on the input. Examples: .. code-block:: python >>> import paddle >>> paddle.enable_static() >>> x = paddle.randn(shape=[32, 100]) >>> hidden2 = paddle.static.nn.data_norm(input=x) """ helper = LayerHelper('data_norm', **locals()) dtype = helper.input_dtype() input_shape = input.shape if len(input_shape) < 2: raise ValueError( f"The shape pf Input < 2 (got {len(input_shape)}D input, input shape is: {input_shape})" ) if data_layout == 'NCHW': channel_num = input_shape[1] else: if data_layout == 'NHWC': channel_num = input_shape[-1] else: raise ValueError("unsupported data layout:" + data_layout) param_shape = [channel_num] batch_size_default = 1e4 batch_sum_default = 0.0 batch_square_sum_default = 1e4 scale_w_default = 1.0 bias_default = 0.0 if param_attr and isinstance(param_attr, dict): batch_size_default = param_attr.get("batch_size", 1e4) batch_sum_default = param_attr.get("batch_sum", 0.0) batch_square_sum_default = param_attr.get("batch_square", 1e4) if enable_scale_and_shift: scale_w_default = param_attr.get("scale_w", 1.0) bias_default = param_attr.get("bias", 0.0) # create scale and shift(bias) when enable_scale_and_shift is True if name is None: name = "dn" if enable_scale_and_shift: scale_w = helper.create_parameter( attr=ParamAttr( name=name + '.scale_w', initializer=Constant(value=float(scale_w_default)), trainable=True, ), shape=param_shape, dtype=input.dtype, ) bias = helper.create_parameter( attr=ParamAttr( name=name + '.bias', initializer=Constant(value=float(bias_default)), trainable=True, ), shape=param_shape, dtype=input.dtype, ) # create parameter batch_size = helper.create_parameter( attr=ParamAttr( name=name + '.batch_size', initializer=Constant(value=float(batch_size_default)), trainable=True, ), shape=param_shape, dtype=input.dtype, ) batch_sum = helper.create_parameter( attr=ParamAttr( name=name + '.batch_sum', initializer=Constant(value=float(batch_sum_default)), trainable=True, ), shape=param_shape, dtype=input.dtype, ) batch_square_sum = helper.create_parameter( attr=ParamAttr( name=name + '.batch_square_sum', initializer=Constant(value=float(batch_square_sum_default)), trainable=True, ), shape=param_shape, dtype=input.dtype, ) means = helper.create_variable(dtype=dtype, stop_gradient=True) scales = helper.create_variable(dtype=dtype, stop_gradient=True) data_norm_out = input if in_place else helper.create_variable(dtype=dtype) inputs = { "X": input, "BatchSize": batch_size, "BatchSum": batch_sum, "BatchSquareSum": batch_square_sum, } attrs = { "epsilon": epsilon, "data_layout": data_layout, "sync_stats": sync_stats, "summary_decay_rate": summary_decay_rate, } if slot_dim > 0: attrs["slot_dim"] = slot_dim if enable_scale_and_shift: attrs["enable_scale_and_shift"] = enable_scale_and_shift if enable_scale_and_shift: inputs["scale_w"] = scale_w inputs["bias"] = bias helper.append_op( type="data_norm", inputs=inputs, outputs={ "Y": data_norm_out, "Means": means, "Scales": scales, "BatchSize": batch_size, "BatchSum": batch_sum, "BatchSquareSum": batch_square_sum, }, attrs=attrs, ) return helper.append_activation(data_norm_out) def group_norm( input, groups, epsilon=1e-05, param_attr=None, bias_attr=None, act=None, data_layout='NCHW', name=None, ): """ **Group Normalization Layer** Refer to `Group Normalization <path_to_url`_ . Parameters: input(Tensor): Tensor with dimension greater than 1, the data type is float32 or float64. groups(int): The number of groups that divided from channels, the data type is int32. epsilon(float, optional): The small value added to the variance to prevent division by zero, the data type is float32. Default: 1e-05. param_attr(ParamAttr|bool, optional): ParamAttr object that specifies weight parameter attribute. If a bool type, only False is supported, which means there is no weight parameter. Default: None, the default weight parameter attribute is used. For more information, please refer to :ref:`api_guide_ParamAttr` . bias_attr(ParamAttr|bool, optional): ParamAttr object that specifies bias parameter attribute. If a bool type, only False is supported, which means there is no bias parameter. Default: None, the default bias parameter attribute is used. For more information, please refer to :ref:`api_guide_ParamAttr` . act(str, optional): Activation to be applied to the output of group normalization. data_layout(str, optional): Specify the data format of the input, and the data format of the output will be consistent with that of the input. An optional string from: `"NCHW"`, `"NHWC"`. The default is `"NCHW"`. When it is `"NCHW"`, the data is stored in the order of: `[batch_size, input_channels, *]`. name (str, optional): The default value is None. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name` . Returns: Tensor: A Tensor has same data type and data format with `input`. Examples: .. code-block:: python >>> import paddle >>> paddle.enable_static() >>> data = paddle.static.data(name='data', shape=[2, 8, 32, 32], dtype='float32') >>> x = paddle.static.nn.group_norm(input=data, groups=4) >>> print(x.shape) (2, 8, 32, 32) """ helper = LayerHelper('group_norm', **locals()) dtype = helper.input_dtype() check_variable_and_dtype( input, 'input', ['float16', 'uint16', 'float32', 'float64'], 'group_norm', ) # create input and parameters inputs = {'X': input} input_shape = input.shape if len(input_shape) < 2: raise ValueError( f"The dimensions of Op(static.nn.group_norm)'s input should be more than 1. But received {len(input_shape)}" ) if data_layout != 'NCHW' and data_layout != 'NHWC': raise ValueError( "Param(data_layout) of Op(static.nn.group_norm) got wrong value: received " + data_layout + " but only NCHW or NHWC supported." ) channel_num = input_shape[1] if data_layout == 'NCHW' else input_shape[-1] param_shape = [channel_num] if param_attr: scale = helper.create_parameter( attr=helper.param_attr, shape=param_shape, dtype=dtype, default_initializer=Constant(1.0), ) inputs['Scale'] = scale if bias_attr: bias = helper.create_parameter( attr=helper.bias_attr, shape=param_shape, dtype=dtype, is_bias=True ) inputs['Bias'] = bias # create output mean_out = helper.create_variable(dtype=dtype, stop_gradient=True) variance_out = helper.create_variable(dtype=dtype, stop_gradient=True) group_norm_out = helper.create_variable(dtype=dtype) helper.append_op( type="group_norm", inputs=inputs, outputs={ "Y": group_norm_out, "Mean": mean_out, "Variance": variance_out, }, attrs={ "epsilon": epsilon, "groups": groups, "data_layout": data_layout, }, ) return helper.append_activation(group_norm_out) def conv2d( input, num_filters, filter_size, stride=1, padding=0, dilation=1, groups=None, param_attr=None, bias_attr=None, use_cudnn=True, act=None, name=None, data_format="NCHW", ): r""" The convolution2D layer calculates the output based on the input, filter and strides, paddings, dilations, groups parameters. Input and Output are in NCHW or NHWC format, where N is batch size, C is the number of channels, H is the height of the feature, and W is the width of the feature. Filter is in MCHW format, where M is the number of output image channels, C is the number of input image channels, H is the height of the filter, and W is the width of the filter. If the groups is greater than 1, C will equal the number of input image channels divided by the groups. Please refer to UFLDL's `convolution <path_to_url`_ for more details. If bias attribution and activation type are provided, bias is added to the output of the convolution, and the corresponding activation function is applied to the final result. For each input :math:`X`, the equation is: .. math:: Out = \sigma (W \\ast X + b) Where: * :math:`X`: Input value, a tensor with NCHW or NHWC format. * :math:`W`: Filter value, a tensor with MCHW format. * :math:`\\ast`: Convolution operation. * :math:`b`: Bias value, a 2-D tensor with shape [M, 1]. * :math:`\\sigma`: Activation function. * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different. Example: - Input: Input shape: :math:`(N, C_{in}, H_{in}, W_{in})` Filter shape: :math:`(C_{out}, C_{in}, H_f, W_f)` - Output: Output shape: :math:`(N, C_{out}, H_{out}, W_{out})` Where .. math:: H_{out}&= \\frac{(H_{in} + 2 * paddings[0] - (dilations[0] * (H_f - 1) + 1))}{strides[0]} + 1 \\\\ W_{out}&= \\frac{(W_{in} + 2 * paddings[1] - (dilations[1] * (W_f - 1) + 1))}{strides[1]} + 1 Args: input (Tensor): The input is 4-D Tensor with shape [N, C, H, W], the data type of input is float16 or float32 or float64. num_filters(int): The number of filter. It is as same as the output image channel. filter_size (int|tuple): The filter size. If filter_size is a tuple, it must contain two integers, (filter_size_height, filter_size_width). Otherwise, filter_size_height = filter_size_width =\ filter_size. stride (int|tuple, optional): The stride size. It means the stride in convolution. If stride is a tuple, it must contain two integers, (stride_height, stride_width). Otherwise, stride_height = stride_width = stride. Default: stride = 1. padding (string|int|list|tuple, optional): The padding size. It means the number of zero-paddings on both sides for each dimension.If `padding` is a string, either 'VALID' or 'SAME' which is the padding algorithm. If padding size is a tuple or list, it could be in three forms: `[pad_height, pad_width]` or `[pad_height_top, pad_height_bottom, pad_width_left, pad_width_right]`, and when `data_format` is `"NCHW"`, `padding` can be in the form `[[0,0], [0,0], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right]]`. when `data_format` is `"NHWC"`, `pool_padding` can be in the form `[[0,0], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right], [0,0]]`. Default: padding = 0. dilation (int|tuple, optional): The dilation size. It means the spacing between the kernel points. If dilation is a tuple, it must contain two integers, (dilation_height, dilation_width). Otherwise, dilation_height = dilation_width = dilation. Default: dilation = 1. groups (int, optional): The groups number of the Conv2d Layer. According to grouped convolution in Alex Krizhevsky's Deep CNN paper: when group=2, the first half of the filters is only connected to the first half of the input channels, while the second half of the filters is only connected to the second half of the input channels. Default: groups=1. param_attr (ParamAttr|None, optional): The parameter attribute for learnable parameters/weights of conv2d. If it is set to None or one attribute of ParamAttr, conv2d will create ParamAttr as param_attr. If the Initializer of the param_attr is not set, the parameter is initialized with :math:`Normal(0.0, std)`, and the :math:`std` is :math:`(\frac{2.0 }{filter\_elem\_num})^{0.5}`. Default: None. bias_attr (ParamAttr|bool|None, optional): The parameter attribute for the bias of conv2d. If it is set to False, no bias will be added to the output units. If it is set to None or one attribute of ParamAttr, conv2d will create ParamAttr as bias_attr. If the Initializer of the bias_attr is not set, the bias is initialized zero. Default: None. use_cudnn (bool, optional): Use cudnn kernel or not, it is valid only when the cudnn library is installed. Default: True act (str, optional): Activation type, if it is set to None, activation is not appended. Default: None name(str|None, optional): For detailed information, please refer to :ref:`api_guide_Name`. Usually name is no need to set and None by default. data_format (str, optional): Specify the data format of the input, and the data format of the output will be consistent with that of the input. An optional string from: `"NCHW"`, `"NHWC"`. The default is `"NCHW"`. When it is `"NCHW"`, the data is stored in the order of: `[batch_size, input_channels, input_height, input_width]`. Returns: A Tensor representing the conv2d, whose data type is the same with input. If act is None, the tensor storing the convolution result, and if act is not None, the tensor storing convolution and non-linearity activation result. Examples: .. code-block:: python >>> import paddle >>> paddle.enable_static() >>> data = paddle.static.data(name='data', shape=[None, 3, 32, 32], dtype='float32') >>> conv2d = paddle.static.nn.conv2d(input=data, num_filters=2, filter_size=3, act="relu") >>> print(conv2d.shape) (-1, 2, 30, 30) """ check_variable_and_dtype( input, 'input', ['uint16', 'float16', 'float32', 'float64'], 'conv2d' ) if len(input.shape) != 4: raise ValueError( "Input size should be 4, " f"but received {len(input.shape)}" ) num_channels = input.shape[1] if not isinstance(use_cudnn, bool): raise ValueError( "Attr(use_cudnn) should be True or False. Received " f"Attr(use_cudnn): {use_cudnn}. " ) if data_format not in ["NCHW", "NHWC"]: raise ValueError( "Attr(data_format) should be 'NCHW' or 'NHWC'. Received " f"Attr(data_format): {data_format}." ) channel_last = data_format == "NHWC" num_channels = input.shape[3] if channel_last else input.shape[1] if num_channels < 0: raise ValueError( f"The channel dimension of the input({input.shape}) should be defined. " f"Received: {num_channels}." ) assert param_attr is not False, "param_attr should not be False here." if groups is None: num_filter_channels = num_channels elif groups <= 0: raise ValueError( "the groups of input must be greater than 0, " f"but received the groups of input is {groups}" ) else: if num_channels % groups != 0: raise ValueError( "the channel of input must be divisible by groups," f"received: the channel of input is {num_channels}, the shape of input is {input.shape}" f", the groups is {groups}" ) num_filter_channels = num_channels // groups l_type = 'conv2d' if ( num_channels == groups and num_filters % num_channels == 0 and not use_cudnn ): l_type = 'depthwise_conv2d' if ( num_channels == groups and num_filters % num_channels == 0 and core.is_compiled_with_rocm() ): l_type = 'depthwise_conv2d' helper = LayerHelper(l_type, **locals()) dtype = helper.input_dtype() filter_size = paddle.utils.convert_to_list(filter_size, 2, 'filter_size') stride = paddle.utils.convert_to_list(stride, 2, 'stride') dilation = paddle.utils.convert_to_list(dilation, 2, 'dilation') # padding def _update_padding(padding, data_format): if isinstance(padding, (list, tuple)) and len(padding) == 4: if isinstance(padding[0], (list, tuple)) and ( data_format == "NCHW" ): if not (padding[0] == [0, 0] and padding[1] == [0, 0]): raise ValueError( f"Non-zero padding({padding}) in the batch or channel dimensions " "is not supported." ) padding = padding[2:4] padding = [ele for a_list in padding for ele in a_list] elif isinstance(padding[0], (list, tuple)) and ( data_format == "NHWC" ): if not (padding[0] == [0, 0] and padding[3] == [0, 0]): raise ValueError( f"Non-zero padding({padding}) in the batch or channel dimensions " "is not supported." ) padding = padding[1:3] padding = [ele for a_list in padding for ele in a_list] padding = paddle.utils.convert_to_list(padding, 4, 'padding') if paddle.utils._is_symmetric_padding(padding, 2): padding = [padding[0], padding[2]] else: padding = paddle.utils.convert_to_list(padding, 2, 'padding') return padding padding_algorithm = "EXPLICIT" if isinstance(padding, str): padding = padding.upper() if padding not in ["SAME", "VALID"]: raise ValueError( f"Unknown padding: '{padding}'. It can only be 'SAME' or 'VALID'." ) if padding == "VALID": padding_algorithm = "VALID" padding = [0, 0] elif padding == "SAME": padding_algorithm = "SAME" padding = [0, 0] padding = _update_padding(padding, data_format) filter_shape = [num_filters, int(num_filter_channels), *filter_size] def _get_default_param_initializer(): filter_elem_num = filter_size[0] * filter_size[1] * num_channels if filter_elem_num <= 0: raise ValueError( "Invalid filter number, excepted number is larger than 0, but" f" received {filter_elem_num}, please check the input shape and " "filter size." ) std = (2.0 / filter_elem_num) ** 0.5 return Normal(0.0, std) filter_param = helper.create_parameter( attr=helper.param_attr, shape=filter_shape, dtype=dtype, default_initializer=_get_default_param_initializer(), ) pre_bias = helper.create_variable_for_type_inference(dtype) if ( core.is_compiled_with_cuda() and paddle.base.get_flags("FLAGS_conv2d_disable_cudnn")[ "FLAGS_conv2d_disable_cudnn" ] ): use_cudnn = False helper.append_op( type=l_type, inputs={ 'Input': input, 'Filter': filter_param, }, outputs={"Output": pre_bias}, attrs={ 'strides': stride, 'paddings': padding, 'dilations': dilation, 'groups': groups, 'use_cudnn': use_cudnn, 'fuse_relu_before_depthwise_conv': False, "padding_algorithm": padding_algorithm, "data_format": data_format, }, ) if data_format == 'NCHW': pre_act = helper.append_bias_op(pre_bias, dim_start=1, dim_end=2) else: pre_act = helper.append_bias_op(pre_bias, dim_start=3, dim_end=4) return helper.append_activation(pre_act) def conv3d( input, num_filters, filter_size, stride=1, padding=0, dilation=1, groups=None, param_attr=None, bias_attr=None, use_cudnn=True, act=None, name=None, data_format="NCDHW", ): r""" The convolution3D layer calculates the output based on the input, filter and strides, paddings, dilations, groups parameters. Input(Input) and Output(Output) are in NCDHW or NDHWC format. Where N is batch size C is the number of channels, D is the depth of the feature, H is the height of the feature, and W is the width of the feature. Convolution3D is similar with Convolution2D but adds one dimension(depth). If bias attribution and activation type are provided, bias is added to the output of the convolution, and the corresponding activation function is applied to the final result. For each input :math:`X`, the equation is: .. math:: Out = \sigma (W \ast X + b) In the above equation: * :math:`X`: Input value, a tensor with NCDHW or NDHWC format. * :math:`W`: Filter value, a tensor with MCDHW format. * :math:`\ast`: Convolution operation. * :math:`b`: Bias value, a 2-D tensor with shape [M, 1]. * :math:`\sigma`: Activation function. * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different. Example: - Input: Input shape: :math:`(N, C_{in}, D_{in}, H_{in}, W_{in})` Filter shape: :math:`(C_{out}, C_{in}, D_f, H_f, W_f)` - Output: Output shape: :math:`(N, C_{out}, D_{out}, H_{out}, W_{out})` Where .. math:: D_{out}&= \frac{(D_{in} + 2 * paddings[0] - (dilations[0] * (D_f - 1) + 1))}{strides[0]} + 1 \\ H_{out}&= \frac{(H_{in} + 2 * paddings[1] - (dilations[1] * (H_f - 1) + 1))}{strides[1]} + 1 \\ W_{out}&= \frac{(W_{in} + 2 * paddings[2] - (dilations[2] * (W_f - 1) + 1))}{strides[2]} + 1 Args: input (Tensor): The input is 5-D Tensor with shape [N, C, D, H, W], the data type of input is float16 or float32 or float64. num_filters(int): The number of filter. It is as same as the output image channel. filter_size (int|tuple): The filter size. If filter_size is a tuple, it must contain three integers, (filter_size_depth, filter_size_height, filter_size_width). Otherwise, filter_size_depth = filter_size_height = \ filter_size_width = filter_size. stride (int|tuple): The stride size. It means the stride in convolution. If stride is a tuple, it must contain three integers, (stride_depth, stride_height, stride_width). Otherwise, stride_depth = stride_height = stride_width = stride. Default: stride = 1. padding (string|int|list|tuple): The padding size. It means the number of zero-paddings on both sides for each dimension. If `padding` is a string, either 'VALID' or 'SAME' which is the padding algorithm. If padding size is a tuple or list, it could be in three forms: `[pad_depth, pad_height, pad_width]` or `[pad_depth_front, pad_depth_back, pad_height_top, pad_height_bottom, pad_width_left, pad_width_right]`, and when `data_format` is `"NCDHW"`, `pool_padding` can be in the form `[[0,0], [0,0], [pad_depth_front, pad_depth_back], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right]]`. when `data_format` is `"NDHWC"`, `pool_padding` can be in the form `[[0,0], [pad_depth_front, pad_depth_back], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right], [0,0]]`. Default: padding = 0. dilation (int|tuple): The dilation size. It means the spacing between the kernel points. If dilation is a tuple, it must contain three integers, (dilation_depth, dilation_height, dilation_width). Otherwise, dilation_depth = dilation_height = dilation_width = dilation. Default: dilation = 1. groups (int): The groups number of the Conv3d Layer. According to grouped convolution in Alex Krizhevsky's Deep CNN paper: when group=2, the first half of the filters is only connected to the first half of the input channels, while the second half of the filters is only connected to the second half of the input channels. Default: groups=1 param_attr (ParamAttr|None): The parameter attribute for learnable parameters/weights of conv3d. If it is set to None or one attribute of ParamAttr, conv3d will create ParamAttr as param_attr. If it is set to None, the parameter is initialized with :math:`Normal(0.0, std)`, and the :math:`std` is :math:`(\\frac{2.0 }{filter\_elem\_num})^{0.5}`. Default: None. bias_attr (ParamAttr|bool|None): The parameter attribute for the bias of conv3d. If it is set to False, no bias will be added to the output units. If it is set to None or one attribute of ParamAttr, conv3d will create ParamAttr as bias_attr. If the Initializer of the bias_attr is not set, the bias is initialized zero. Default: None. use_cudnn (bool): Use cudnn kernel or not, it is valid only when the cudnn library is installed. Default: True act (str): Activation type, if it is set to None, activation is not appended. Default: None. name(str|None): For detailed information, please refer to :ref:`api_guide_Name`. Usually name is no need to set and None by default. data_format (str, optional): Specify the data format of the input, and the data format of the output will be consistent with that of the input. An optional string from: `"NCHW"`, `"NHWC"`. The default is `"NCHW"`. When it is `"NCHW"`, the data is stored in the order of: `[batch_size, input_channels, input_height, input_width]`. Returns: A Tensor representing the conv3d, whose data type is the same with input. If act is None, the tensor variable storing the convolution result, and if act is not None, the tensor variable storing convolution and non-linearity activation result. Examples: .. code-block:: python >>> import paddle >>> import numpy as np >>> np.random.seed(1107) >>> paddle.seed(1107) >>> paddle.enable_static() >>> data = paddle.static.data(name='data', shape=[None, 3, 12, 32, 32], dtype='float32') >>> param_attr = paddle.framework.ParamAttr(name='conv3d.weight', initializer=paddle.nn.initializer.XavierNormal(), learning_rate=0.001) >>> res = paddle.static.nn.conv3d(input=data, num_filters=2, filter_size=3, act="relu", param_attr=param_attr) >>> place = paddle.CPUPlace() >>> exe = paddle.static.Executor(place) >>> exe.run(paddle.static.default_startup_program()) >>> x = np.random.rand(1, 3, 12, 32, 32).astype("float32") >>> output, = exe.run(feed={"data": x}, fetch_list=[res]) >>> print(output.shape) (1, 2, 10, 30, 30) """ l_type = 'conv3d' assert param_attr is not False, "param_attr should not be False here." helper = LayerHelper(l_type, **locals()) dtype = helper.input_dtype() if not isinstance(use_cudnn, bool): raise ValueError( "Attr(use_cudnn) should be True or False. Received " f"Attr(use_cudnn): {use_cudnn}. " ) if data_format not in ["NCDHW", "NDHWC"]: raise ValueError( "Attr(data_format) should be 'NCDHW' or 'NDHWC'. Received " f"Attr(data_format): {data_format}." ) channel_last = data_format == "NDHWC" if len(input.shape) != 5: raise ValueError( f"Input should be 5D tensor, but received input with the shape of {input.shape}" ) num_channels = input.shape[4] if channel_last else input.shape[1] if num_channels < 0: raise ValueError( f"The channel dimension of the input({input.shape}) should be defined. " f"Received: {num_channels}." ) if groups is None: num_filter_channels = num_channels elif groups <= 0: raise ValueError( f"the groups of conv3d should be greater than 0. Received groups: {groups}" ) else: if num_channels % groups != 0: raise ValueError( "The number of input channels must be divisible by Attr(groups). " f"Received: number of channels({num_channels}), groups({groups})." ) num_filter_channels = num_channels // groups filter_size = paddle.utils.convert_to_list(filter_size, 3, 'filter_size') stride = paddle.utils.convert_to_list(stride, 3, 'stride') dilation = paddle.utils.convert_to_list(dilation, 3, 'dilation') def _update_padding(padding, data_format): if isinstance(padding, (list, tuple)) and len(padding) == 5: if isinstance(padding[0], (list, tuple)) and ( data_format == "NCDHW" ): if not (padding[0] == [0, 0] and padding[1] == [0, 0]): raise ValueError( f"Non-zero padding({padding}) in the batch or channel dimensions " "is not supported." ) padding = padding[2:5] padding = [ele for a_list in padding for ele in a_list] elif isinstance(padding[0], (list, tuple)) and ( data_format == "NDHWC" ): if not (padding[0] == [0, 0] and padding[4] == [0, 0]): raise ValueError( f"Non-zero padding({padding}) in the batch or channel dimensions " "is not supported." ) padding = padding[1:4] padding = [ele for a_list in padding for ele in a_list] padding = paddle.utils.convert_to_list(padding, 6, 'padding') if paddle.utils._is_symmetric_padding(padding, 3): padding = [padding[0], padding[2], padding[4]] elif isinstance(padding, (list, tuple)) and len(padding) == 6: padding = paddle.utils.convert_to_list(padding, 6, 'padding') if paddle.utils._is_symmetric_padding(padding, 3): padding = [padding[0], padding[2], padding[4]] else: padding = paddle.utils.convert_to_list(padding, 3, 'padding') return padding padding_algorithm = "EXPLICIT" if isinstance(padding, str): padding = padding.upper() if padding not in ["SAME", "VALID"]: raise ValueError( f"Unknown padding: '{padding}'. It can only be 'SAME' or 'VALID'." ) if padding == "VALID": padding_algorithm = "VALID" padding = [0, 0, 0] elif padding == "SAME": padding_algorithm = "SAME" padding = [0, 0, 0] padding = _update_padding(padding, data_format) input_shape = input.shape filter_shape = [num_filters, num_filter_channels, *filter_size] def _get_default_param_initializer(): filter_elem_num = ( filter_size[0] * filter_size[1] * filter_size[2] * num_channels ) if filter_elem_num <= 0: raise ValueError( "Invalid filter number, excepted number is larger than 0, but" f" received {filter_elem_num}, please check the input shape and " "filter size." ) std = (2.0 / filter_elem_num) ** 0.5 return Normal(0.0, std) filter_param = helper.create_parameter( attr=helper.param_attr, shape=filter_shape, dtype=dtype, default_initializer=_get_default_param_initializer(), ) pre_bias = helper.create_variable_for_type_inference(dtype) helper.append_op( type=l_type, inputs={ 'Input': input, 'Filter': filter_param, }, outputs={"Output": pre_bias}, attrs={ 'strides': stride, 'paddings': padding, 'dilations': dilation, 'groups': groups, 'use_cudnn': use_cudnn, "padding_algorithm": padding_algorithm, "data_format": data_format, }, ) if data_format == 'NCDHW': pre_act = helper.append_bias_op(pre_bias, dim_start=1, dim_end=2) else: pre_act = helper.append_bias_op(pre_bias, dim_start=4, dim_end=5) return helper.append_activation(pre_act) def conv2d_transpose( input, num_filters, output_size=None, filter_size=None, padding=0, stride=1, dilation=1, groups=None, param_attr=None, bias_attr=None, use_cudnn=True, act=None, name=None, data_format='NCHW', ): r""" The convolution2D transpose layer calculates the output based on the input, filter, and dilations, strides, paddings. Input(Input) and output(Output) are in NCHW or NHWC format. Where N is batch size, C is the number of channels, H is the height of the feature, and W is the width of the feature. Parameters(dilations, strides, paddings) are two elements. These two elements represent height and width, respectively. The details of convolution transpose layer, please refer to the following explanation and references `therein <path_to_url`_. If bias attribution and activation type are provided, bias is added to the output of the convolution, and the corresponding activation function is applied to the final result. For each input :math:`X`, the equation is: .. math:: Out = \sigma (W \ast X + b) Where: * :math:`X`: Input value, a 4-D Tensor with NCHW or NHWC format. * :math:`W`: Filter value, a 4-D Tensor with MCHW format. * :math:`\ast`: Convolution operation. * :math:`b`: Bias value, a 2-D Tensor with shape [M, 1]. * :math:`\sigma`: Activation function. * :math:`Out`: Output value, a 4-D Tensor with data format 'NCHW' or 'NHWC', the shape of :math:`Out` and :math:`X` may be different. Example: - Input: Input shape: :math:`(N, C_{in}, H_{in}, W_{in})` Filter shape: :math:`(C_{in}, C_{out}, H_f, W_f)` - Output: Output shape: :math:`(N, C_{out}, H_{out}, W_{out})` Where .. math:: H^\prime_{out} &= (H_{in} - 1) * strides[0] - 2 * paddings[0] + dilations[0] * (H_f - 1) + 1 \\ W^\prime_{out} &= (W_{in} - 1) * strides[1] - 2 * paddings[1] + dilations[1] * (W_f - 1) + 1 \\ H_{out} &\in [ H^\prime_{out}, H^\prime_{out} + strides[0] ] \\ W_{out} &\in [ W^\prime_{out}, W^\prime_{out} + strides[1] ] If `padding` = `"SAME"`: .. math:: H^\prime_{out} &= \frac{(H_{in} + stride[0] - 1)}{stride[0]} \\ W^\prime_{out} &= \frac{(H_{in} + stride[1] - 1)}{stride[1]} If `padding` = `"VALID"`: .. math:: H^\prime_{out} &= (H_{in} - 1) * strides[0] + dilations[0] * (H_f - 1) + 1 \\ W^\prime_{out} &= (W_{in} 1) * strides[1] + dilations[1] * (W_f 1) + 1 If output_size is None, :math:`H_{out} = H^\prime_{out}, W_{out} = W^\prime_{out}`; else, the :math:`H_{out}` of the output size must between :math:`H^\prime_{out}` and :math:`H^\prime_{out} + strides[0]`, and the :math:`W_{out}` of the output size must between :math:`W^\prime_{out}` and :math:`W^\prime_{out} + strides[1]`, Since transposed convolution can be treated as the inverse of convolution, and according to the input-output formula for convolution, different sized input feature layers may correspond to the same sized output feature layer, the size of the output feature layer for a fixed sized input feature layer is not unique to transposed convolution If `output_size` is specified, `conv2d_transpose` can compute the kernel size automatically. Args: input(Tensor): 4-D Tensor with [N, C, H, W] or [N, H, W, C] format where N is the batch_size, C is the input_channels, H is the input_height and W is the input_width. Its data type is float32 or float64. num_filters(int): The number of the filter. It is as same as the output image channel. output_size(int|tuple, optional): The output image size. If output size is a tuple, it must contain two integers, (image_height, image_width). None if use filter_size, padding, and stride to calculate output_size. If output_size and filter_size are specified at the same time, They should follow the formula above. Default: None. output_size and filter_size should not be None at the same time. filter_size(int|tuple, optional): The filter size. If filter_size is a tuple, it must contain two integers, (filter_size_height, filter_size_width). Otherwise, filter_size_height = filter_size_width = filter_size. None if use output size to calculate filter_size. Default: None. filter_size and output_size should not be None at the same time. padding(str|int|list|tuple, optional): The padding size. It means the number of zero-paddings on both sides for each dimension. If `padding` is a string, either 'VALID' or 'SAME' which is the padding algorithm. If `padding` is a tuple or list, it could be in three forms: (1) Contains 4 binary groups: when `data_format` is `"NCHW"`, `padding` can be in the form `[[0,0], [0,0], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right]]`. when `data_format` is `"NHWC"`, `padding` can be in the form `[[0,0], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right], [0,0]]`. (2) Contains 4 integer values`[pad_height_top, pad_height_bottom, pad_width_left, pad_width_right]` (3) Contains 2 integer values`[pad_height, pad_width]`, in this case, `padding_height_top = padding_height_bottom = padding_height` `padding_width_left = padding_width_right = padding_width`. If an integer, `padding_height = padding_width = padding`. Default: padding = 0. stride(int|tuple, optional): The stride size. It means the stride in transposed convolution. If stride is a tuple, it must contain two integers, (stride_height, stride_width). Otherwise, stride_height = stride_width = stride. Default: stride = 1. dilation(int|tuple, optional): The dilation size. It means the spacing between the kernel points. If dilation is a tuple, it must contain two integers, (dilation_height, dilation_width). Otherwise, dilation_height = dilation_width = dilation. Default: dilation = 1. groups(int, optional): The groups number of the Conv2d transpose layer. Inspired by grouped convolution in Alex Krizhevsky's Deep CNN paper, in which when group=2, the first half of the filters is only connected to the first half of the input channels, while the second half of the filters is only connected to the second half of the input channels. Default: groups = 1. param_attr (ParamAttr, optional): The parameter attribute for learnable parameters/weights of conv2d_transpose. If it is set to None or one attribute of ParamAttr, conv2d_transpose will create ParamAttr as param_attr. If the Initializer of the param_attr is not set, the parameter is initialized with Xavier. Default: None. bias_attr (ParamAttr|bool, optional): Specifies the object for the bias parameter attribute. The default value is None, which means that the default bias parameter attribute is used. For detailed information, please refer to :ref:`api_paddle_ParamAttr`. The default bias initialisation for the conv2d_transpose operator is 0.0. use_cudnn(bool, optional): Use cudnn kernel or not, it is valid only when the cudnn library is installed. Default: True. act (str, optional): Activation type, if it is set to None, activation is not appended. Default: None. name(str, optional): For detailed information, please refer to :ref:`api_guide_Name`. Usually name is no need to set and None by default. data_format (str, optional): Specify the data format of the input, and the data format of the output will be consistent with that of the input. An optional string from: `"NCHW"`, `"NHWC"`. The default is `"NCHW"`. When it is `"NCHW"`, the data is stored in the order of: `[batch_size, input_channels, input_height, input_width]`. Returns: A Tensor representing the conv2d_transpose, whose data type is the same with input and shape is (num_batches, channels, out_h, out_w) or (num_batches, out_h, out_w, channels). If act is None, the tensor storing the transposed convolution result, and if act is not None, the tensor storing transposed convolution and non-linearity activation result. Raises: ValueError: If the type of `use_cudnn` is not bool. ValueError: If `data_format` is not "NCHW" or "NHWC". ValueError: If `padding` is a string, but not "SAME" or "VALID". ValueError: If `padding` is a tuple, but the element corresponding to the input's batch size is not 0 or the element corresponding to the input's channel is not 0. ValueError: If `output_size` and filter_size are None at the same time. ShapeError: If the input is not 4-D Tensor. ShapeError: If the input's dimension size and filter's dimension size not equal. ShapeError: If the dimension size of input minus the size of `stride` is not 2. ShapeError: If the number of input channels is not equal to filter's channels. ShapeError: If the size of `output_size` is not equal to that of `stride`. Examples: .. code-block:: python >>> import paddle >>> paddle.enable_static() >>> data = paddle.static.data(name='data', shape=[None, 3, 32, 32], dtype='float32') >>> conv2d_transpose = paddle.static.nn.conv2d_transpose(input=data, num_filters=2, filter_size=3) >>> print(conv2d_transpose.shape) (-1, 2, 34, 34) """ assert ( param_attr is not False ), "param_attr should not be False in conv2d_transpose." if len(input.shape) != 4: raise ValueError( "Input size should be 4, " f"but received {len(input.shape)}" ) if num_filters == 0: raise ValueError("num of filters should not be 0.") if data_format not in ['NCHW', 'NHWC']: raise ValueError( "Attr(data_format) of Op(paddle.static.nn.layers.conv2d_transpose) got wrong value: received " + data_format + " but only NCHW or NHWC supported." ) input_channel = input.shape[1] if data_format == 'NCHW' else input.shape[-1] op_type = 'conv2d_transpose' if ( input_channel == groups and num_filters == input_channel and not use_cudnn ): op_type = 'depthwise_conv2d_transpose' helper = LayerHelper(op_type, **locals()) if not isinstance(input, Variable): raise TypeError("Input of conv2d_transpose must be Tensor") stride = paddle.utils.convert_to_list(stride, 2, 'stride') dilation = paddle.utils.convert_to_list(dilation, 2, 'dilation') if not isinstance(use_cudnn, bool): raise ValueError("use_cudnn should be True or False") def _update_padding(padding, data_format): if isinstance(padding, (list, tuple)) and len(padding) == 4: if isinstance(padding[0], (list, tuple)) and ( data_format == "NCHW" ): if not (padding[0] == [0, 0] and padding[1] == [0, 0]): raise ValueError( f"Non-zero padding({padding}) in the batch or channel dimensions " "is not supported." ) padding = padding[2:4] padding = [ele for a_list in padding for ele in a_list] elif isinstance(padding[0], (list, tuple)) and ( data_format == "NHWC" ): if not (padding[0] == [0, 0] and padding[3] == [0, 0]): raise ValueError( f"Non-zero padding({padding}) in the batch or channel dimensions " "is not supported." ) padding = padding[1:3] padding = [ele for a_list in padding for ele in a_list] padding = paddle.utils.convert_to_list(padding, 4, 'padding') else: padding = paddle.utils.convert_to_list(padding, 2, 'padding') padding = [padding[0], padding[0], padding[1], padding[1]] return padding padding_algorithm = "EXPLICIT" if isinstance(padding, str): padding = padding.upper() if padding not in ["SAME", "VALID"]: raise ValueError( f"Unknown padding: '{padding}'. It can only be 'SAME' or 'VALID'." ) if padding == "VALID": padding_algorithm = "VALID" padding = [0, 0, 0, 0] elif padding == "SAME": padding_algorithm = "SAME" padding = [0, 0, 0, 0] padding = _update_padding(padding, data_format) if output_size is None: output_size = [] elif isinstance(output_size, (list, tuple)): if paddle.utils._contain_var(output_size): output_size = paddle.utils._convert_to_tensor_list(output_size) else: output_size = paddle.utils.convert_to_list( output_size, 2, 'output_size' ) elif isinstance(output_size, int): output_size = paddle.utils.convert_to_list( output_size, 2, 'output_size' ) elif isinstance(output_size, Variable): check_dtype( output_size.dtype, 'output_size', ['int32', 'int64'], 'conv2d_transpose', ) if len(output_size.shape) == 1 and ( output_size.shape[0] == 1 or output_size.shape[0] == 2 ): if output_size.shape[0] == 1: output_size = [output_size, output_size] else: raise ValueError("output_size must contain one or two integers.") else: raise ValueError( "output_size should be int, list[int] or tuple[int] or Tensor" ) if filter_size is None: if output_size == []: raise ValueError("output_size must be set when filter_size is None") if not in_dygraph_mode(): if isinstance(output_size, Variable) or paddle.utils._contain_var( output_size ): raise ValueError( "filter_size should not be None when output_size is Tensor or contain Tensor in static graph mode." ) else: output_size = paddle.utils.convert_shape_to_list(output_size) if len(output_size) == 1: output_size = paddle.utils.convert_to_list( output_size[0], 2, 'output_size' ) h_in = input.shape[2] if data_format == 'NCHW' else input.shape[1] w_in = input.shape[3] if data_format == 'NCHW' else input.shape[2] filter_size_h = ( output_size[0] - (h_in - 1) * stride[0] + padding[0] + padding[1] - 1 ) // dilation[0] + 1 filter_size_w = ( output_size[1] - (w_in - 1) * stride[1] + padding[2] + padding[3] - 1 ) // dilation[1] + 1 filter_size = [filter_size_h, filter_size_w] else: filter_size = paddle.utils.convert_to_list( filter_size, 2, 'conv2d_transpose.filter_size' ) if len(padding) == 4 and paddle.utils._is_symmetric_padding(padding, 2): padding = [padding[0], padding[2]] if groups is None: groups = 1 elif groups <= 0: raise ValueError( "the groups of input must be greater than 0, " f"but received the groups of input is {groups}" ) filter_shape = [input_channel, num_filters // groups, *filter_size] img_filter = helper.create_parameter( dtype=input.dtype, shape=filter_shape, attr=helper.param_attr ) pre_bias = helper.create_variable_for_type_inference(dtype=input.dtype) helper.append_op( type=op_type, inputs={'Input': [input], 'Filter': [img_filter]}, outputs={'Output': pre_bias}, attrs={ 'output_size': output_size, 'strides': stride, 'paddings': padding, 'padding_algorithm': padding_algorithm, 'dilations': dilation, 'groups': groups, 'use_cudnn': use_cudnn, 'data_format': data_format, }, ) if data_format == 'NCHW': pre_act = helper.append_bias_op(pre_bias, dim_start=1, dim_end=2) else: pre_act = helper.append_bias_op(pre_bias, dim_start=3, dim_end=4) out = helper.append_activation(pre_act) return out def conv3d_transpose( input, num_filters, output_size=None, filter_size=None, padding=0, stride=1, dilation=1, groups=None, param_attr=None, bias_attr=None, use_cudnn=True, act=None, name=None, data_format='NCDHW', ): r""" The convolution3D transpose layer calculates the output based on the input, filter, and dilations, strides, paddings. Input(Input) and output(Output) are in NCDHW or NDHWC format. Where N is batch size, C is the number of channels, D is the depth of the feature, H is the height of the feature, and W is the width of the feature. Parameters(dilations, strides, paddings) are two elements. These two elements represent height and width, respectively. The details of convolution transpose layer, please refer to the following explanation and references `therein <path_to_url`_. If bias attribution and activation type are provided, bias is added to the output of the convolution, and the corresponding activation function is applied to the final result. For each input :math:`X`, the equation is: .. math:: Out = \sigma (W \ast X + b) In the above equation: * :math:`X`: Input value, a Tensor with NCDHW or NDHWC format. * :math:`W`: Filter value, a Tensor with MCDHW format. * :math:`\ast`: Convolution operation. * :math:`b`: Bias value, a 2-D Tensor with shape [M, 1]. * :math:`\sigma`: Activation function. * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different. Example: - Input: Input shape: :math:`(N, C_{in}, D_{in}, H_{in}, W_{in})` Filter shape: :math:`(C_{in}, C_{out}, D_f, H_f, W_f)` - Output: Output shape: :math:`(N, C_{out}, D_{out}, H_{out}, W_{out})` Where .. math:: D^\prime_{out} &= (D_{in} - 1) * strides[0] - 2 * paddings[0] + dilations[0] * (D_f - 1) + 1 \\ H^\prime_{out} &= (H_{in} - 1) * strides[1] - 2 * paddings[1] + dilations[1] * (H_f - 1) + 1 \\ W^\prime_{out} &= (W_{in} - 1) * strides[2] - 2 * paddings[2] + dilations[2] * (W_f - 1) + 1 \\ D_{out} &\in [ D^\prime_{out}, D^\prime_{out} + strides[0] ] \\ H_{out} &\in [ H^\prime_{out}, H^\prime_{out} + strides[1] ] \\ W_{out} &\in [ W^\prime_{out}, W^\prime_{out} + strides[2] ] If `padding` = `"SAME"`: .. math:: D^\prime_{out} &= \frac{(D_{in} + stride[0] - 1)}{stride[0]} \\ H^\prime_{out} &= \frac{(H_{in} + stride[1] - 1)}{stride[1]} \\ W^\prime_{out} &= \frac{(H_{in} + stride[2] - 1)}{stride[2]} If `padding` = `"VALID"`: .. math:: D^\prime_{out} &= (D_{in} - 1) * strides[0] + dilations[0] * (D_f - 1) + 1 \\ H^\prime_{out} &= (H_{in} - 1) * strides[1] + dilations[1] * (H_f - 1) + 1 \\ W^\prime_{out} &= (W_{in} 1) * strides[2] + dilations[2] * (W_f 1) + 1 If `output_size` is None, :math:`D_{out} = D^\prime_{out}, :math:`H_{out} = \ H^\prime_{out}, W_{out} = W^\prime_{out}`; else, the specified `output_size_depth` (the depth of the output feature layer) :math:`D_{out}` must between :math:`D^\prime_{out}` and :math:`D^\prime_{out} + strides[0]`(not including :math:`D^\prime_{out} + strides[0]`), the specified `output_size_height` (the height of the output feature layer) :math:`H_{out}` must between :math:`H^\prime_{out}` and :math:`H^\prime_{out} + strides[1]`(not including :math:`H^\prime_{out} + strides[1]`), and the specified `output_size_width` (the width of the output feature layer) :math:`W_{out}` must between :math:`W^\prime_{out}` and :math:`W^\prime_{out} + strides[2]`(not including :math:`W^\prime_{out} + strides[2]`). Since transposed convolution can be treated as the inverse of convolution, and since different sized input feature layers may correspond to the same sized output feature layer according to the input-output formula for convolution, the size of the output feature layer for a fixed sized input feature layer is not unique to transposed convolution. If `output_size` is specified, `conv3d_transpose` can compute the kernel size automatically. Args: input(Tensor): The input is 5-D Tensor with shape [N, C, D, H, W] or [N, D, H, W, C], the data type of input is float32 or float64. num_filters(int): The number of the filter. It is as same as the output image channel. output_size(int|tuple, optional): The output image size. If output size is a tuple, it must contain three integers, (image_depth, image_height, image_width). This parameter only works when filter_size is None. If output_size and filter_size are specified at the same time, They should follow the formula above. Default: None. Output_size and filter_size should not be None at the same time. filter_size(int|tuple, optional): The filter size. If filter_size is a tuple, it must contain three integers, (filter_size_depth, filter_size_height, filter_size_width). Otherwise, filter_size_depth = filter_size_height = \ filter_size_width = filter_size. None if use output size to calculate filter_size. Default: None. filter_size and output_size should not be None at the same time. padding(int|list|str|tuple, optional): The padding size. The padding argument effectively adds `dilation * (kernel - 1)` amount of zero-padding on both sides of input. If `padding` is a string, either 'VALID' or 'SAME' supported, which is the padding algorithm. If `padding` is a tuple or list, it could be in three forms: `[pad_depth, pad_height, pad_width]` or `[pad_depth_front, pad_depth_back, pad_height_top, pad_height_bottom, pad_width_left, pad_width_right]`, and when `data_format` is `'NCDHW'`, `padding` can be in the form `[[0,0], [0,0], [pad_depth_front, pad_depth_back], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right]]`. when `data_format` is `'NDHWC'`, `padding` can be in the form `[[0,0], [pad_depth_front, pad_depth_back], [pad_height_top, pad_height_bottom], [pad_width_left, pad_width_right], [0,0]]`. Default: padding = 0. stride(int|tuple, optional): The stride size. It means the stride in transposed convolution. If stride is a tuple, it must contain three integers, (stride_depth, stride_height, stride_width). Otherwise, stride_depth = stride_height = stride_width = stride. Default: stride = 1. dilation(int|tuple, optional): The dilation size. It means the spacing between the kernel points. If dilation is a tuple, it must contain three integers, (dilation_depth, dilation_height, dilation_width). Otherwise, dilation_depth = dilation_height = dilation_width = dilation. Default: dilation = 1. groups(int, optional): The groups number of the Conv3d transpose layer. Inspired by grouped convolution in Alex Krizhevsky's Deep CNN paper, in which when group=2, the first half of the filters is only connected to the first half of the input channels, while the second half of the filters is only connected to the second half of the input channels. Default: groups=1 param_attr (ParamAttr, optional): The parameter attribute for learnable parameters/weights of conv3d_transpose. If it is set to None or one attribute of ParamAttr, conv3d_transpose will create ParamAttr as param_attr. If the Initializer of the param_attr is not set, the parameter is initialized with Xavier. Default: None. bias_attr (ParamAttr|bool, optional): The parameter attribute for the bias of conv3d_transpose. If it is set to False, no bias will be added to the output units. If it is set to None or one attribute of ParamAttr, conv3d_transpose will create ParamAttr as bias_attr. If the Initializer of the bias_attr is not set, the bias is initialized zero. Default: None. use_cudnn(bool, optional): Use cudnn kernel or not, it is valid only when the cudnn library is installed. Default: True act (str, optional): Activation type, if it is set to None, activation is not appended. Default: None. name(str, optional): For detailed information, please refer to :ref:`api_guide_Name`. Usually name is no need to set and None by default. data_format (str, optional): Specify the data format of the input, and the data format of the output will be consistent with that of the input. An optional string from: `"NCHW"`, `"NHWC"`. The default is `"NCHW"`. When it is `"NCHW"`, the data is stored in the order of: `[batch_size, input_channels, input_height, input_width]`. Returns: A Tensor representing the conv3d_transpose, whose data type is the same with input and shape is (num_batches, channels, out_d, out_h, out_w) or (num_batches, out_d, out_h, out_w, channels). If act is None, the tensor variable storing the transposed convolution result, and if act is not None, the tensor variable storing transposed convolution and non-linearity activation result. Examples: .. code-block:: python >>> import paddle >>> import numpy as np >>> paddle.seed(1107) >>> np.random.seed(1107) >>> paddle.enable_static() >>> data = paddle.static.data(name='data', shape=[None, 3, 12, 32, 32], dtype='float32') >>> param_attr = paddle.framework.ParamAttr(name='conv3d.weight', initializer=paddle.nn.initializer.XavierNormal(), learning_rate=0.001) >>> res = paddle.static.nn.conv3d_transpose(input=data, num_filters=2, filter_size=3, act="relu", param_attr=param_attr) >>> place = paddle.CPUPlace() >>> exe = paddle.static.Executor(place) >>> exe.run(paddle.static.default_startup_program()) >>> x = np.random.rand(1, 3, 12, 32, 32).astype("float32") >>> output = exe.run(feed={"data": x}, fetch_list=[res.mean()]) >>> print(output) [array(0.5148856, dtype=float32)] """ assert ( param_attr is not False ), "param_attr should not be False in conv3d_transpose." if data_format not in ['NCDHW', 'NDHWC']: raise ValueError( "Param(data_format) of Op(paddle.static.nn.conv3d_transpose) got wrong value: received " + data_format + " but only NCDHW or NDHWC supported." ) l_type = "conv3d_transpose" helper = LayerHelper(l_type, **locals()) if not isinstance(input, Variable): raise TypeError("Input of conv3d_transpose must be Tensor") if len(input.shape) != 5: raise ValueError( f"Input should be 5D tensor, but received input with the shape of {input.shape}" ) input_channel = ( input.shape[1] if data_format == 'NCDHW' else input.shape[-1] ) stride = paddle.utils.convert_to_list(stride, 3, 'stride') dilation = paddle.utils.convert_to_list(dilation, 3, 'dilation') if not isinstance(use_cudnn, bool): raise ValueError("use_cudnn should be True or False") def _update_padding(padding, data_format): if isinstance(padding, (list, tuple)) and len(padding) == 5: if isinstance(padding[0], (list, tuple)) and ( data_format == "NCDHW" ): if not (padding[0] == [0, 0] and padding[1] == [0, 0]): raise ValueError( f"Non-zero padding({padding}) in the batch or channel dimensions " "is not supported." ) padding = padding[2:5] padding = [ele for a_list in padding for ele in a_list] elif isinstance(padding[0], (list, tuple)) and ( data_format == "NDHWC" ): if not (padding[0] == [0, 0] and padding[4] == [0, 0]): raise ValueError( f"Non-zero padding({padding}) in the batch or channel dimensions " "is not supported." ) padding = padding[1:4] padding = [ele for a_list in padding for ele in a_list] padding = paddle.utils.convert_to_list(padding, 6, 'padding') elif isinstance(padding, (list, tuple)) and len(padding) == 6: padding = paddle.utils.convert_to_list(padding, 6, 'padding') else: padding = paddle.utils.convert_to_list(padding, 3, 'padding') padding = [ padding[0], padding[0], padding[1], padding[1], padding[2], padding[2], ] return padding padding_algorithm = "EXPLICIT" if isinstance(padding, str): padding = padding.upper() if padding not in ["SAME", "VALID"]: raise ValueError( f"Unknown padding: '{padding}'. It can only be 'SAME' or 'VALID'." ) if padding == "VALID": padding_algorithm = "VALID" padding = [0, 0, 0, 0, 0, 0] elif padding == "SAME": padding_algorithm = "SAME" padding = [0, 0, 0, 0, 0, 0] padding = _update_padding(padding, data_format) if filter_size is None: if output_size is None: raise ValueError("output_size must be set when filter_size is None") if isinstance(output_size, int): output_size = [output_size, output_size, output_size] d_in = input.shape[2] if data_format == 'NCDHW' else input.shape[1] h_in = input.shape[3] if data_format == 'NCDHW' else input.shape[2] w_in = input.shape[4] if data_format == 'NCDHW' else input.shape[3] filter_size_d = ( output_size[0] - (d_in - 1) * stride[0] + padding[0] + padding[1] - 1 ) // dilation[0] + 1 filter_size_h = ( output_size[1] - (h_in - 1) * stride[1] + padding[2] + padding[3] - 1 ) // dilation[1] + 1 filter_size_w = ( output_size[2] - (w_in - 1) * stride[2] + padding[4] + padding[5] - 1 ) // dilation[2] + 1 filter_size = [filter_size_d, filter_size_h, filter_size_w] else: filter_size = paddle.utils.convert_to_list( filter_size, 3, 'conv3d_transpose.filter_size' ) if len(padding) == 6 and paddle.utils._is_symmetric_padding(padding, 3): padding = [padding[0], padding[2], padding[4]] if output_size is None: output_size = [] elif isinstance(output_size, (list, tuple, int)): output_size = paddle.utils.convert_to_list( output_size, 3, 'output_size' ) else: raise ValueError("output_size should be int, list[int] or tuple[int]") groups = 1 if groups is None else groups if groups <= 0: raise ValueError( f"the groups of conv3d_transpose should be greater than 0. Received groups: {groups}" ) if num_filters % groups != 0: raise ValueError( "Attr(num_filters) must be divisible by groups," f"Received: Attr(num_filters) is {num_filters}, the groups is {groups}" ) filter_shape = [input_channel, num_filters // groups, *filter_size] img_filter = helper.create_parameter( dtype=input.dtype, shape=filter_shape, attr=helper.param_attr ) if data_format == 'NCDHW': data_format = 'NCHW' if data_format == 'NDHWC': data_format = 'NHWC' pre_bias = helper.create_variable_for_type_inference(dtype=input.dtype) helper.append_op( type=l_type, inputs={'Input': [input], 'Filter': [img_filter]}, outputs={'Output': pre_bias}, attrs={ 'output_size': output_size, 'strides': stride, 'paddings': padding, 'padding_algorithm': padding_algorithm, 'dilations': dilation, 'groups': groups, 'use_cudnn': use_cudnn, 'data_format': data_format, }, ) if data_format == 'NCHW': pre_act = helper.append_bias_op(pre_bias, dim_start=1, dim_end=2) else: pre_act = helper.append_bias_op(pre_bias, dim_start=4, dim_end=5) out = helper.append_activation(pre_act) return out def deformable_conv( input, offset, mask, num_filters, filter_size, stride=1, padding=0, dilation=1, groups=None, deformable_groups=None, im2col_step=None, param_attr=None, bias_attr=None, modulated=True, name=None, ): r""" **Deformable Convolution op** Compute 2-D deformable convolution on 4-D input. Given input image x, output feature map y, the deformable convolution operation can be expressed as follow: Deformable Convolution v2: .. math:: y(p) = \sum_{k=1}^{K}{w_k * x(p + p_k + \Delta p_k) * \Delta m_k} Deformable Convolution v1: .. math:: y(p) = \sum_{k=1}^{K}{w_k * x(p + p_k + \Delta p_k)} Where :math:`\Delta p_k` and :math:`\Delta m_k` are the learnable offset and modulation scalar for the k-th location, Which :math:`\Delta m_k` is one in deformable convolution v1. Please refer to `Deformable ConvNets v2: More Deformable, Better Results <path_to_url`_ and `Deformable Convolutional Networks <path_to_url`_. Example: - Input: Input shape: :math:`(N, C_{in}, H_{in}, W_{in})` Filter shape: :math:`(C_{out}, C_{in}, H_f, W_f)` Offset shape: :math:`(N, 2 * deformable\_groups * H_f * H_w, H_{in}, W_{in})` Mask shape: :math:`(N, deformable\_groups * H_f * H_w, H_{in}, W_{in})` - Output: Output shape: :math:`(N, C_{out}, H_{out}, W_{out})` Where .. math:: H_{out}&= \frac{(H_{in} + 2 * paddings[0] - (dilations[0] * (H_f - 1) + 1))}{strides[0]} + 1 \\ W_{out}&= \frac{(W_{in} + 2 * paddings[1] - (dilations[1] * (W_f - 1) + 1))}{strides[1]} + 1 Args: input (Tensor): The input image with [N, C, H, W] format. A Tensor with type float32, float64. offset (Tensor): The input coordinate offset of deformable convolution layer. A Tensor with type float32, float64. Mask (Tensor, Optional): The input mask of deformable convolution layer. A Tensor with type float32, float64. It should be None when you use deformable convolution v1. num_filters(int): The number of filter. It is as same as the output image channel. filter_size (int|tuple): The filter size. If filter_size is a tuple, it must contain two integers, (filter_size_H, filter_size_W). Otherwise, the filter will be a square. stride (int|tuple): The stride size. If stride is a tuple, it must contain two integers, (stride_H, stride_W). Otherwise, the stride_H = stride_W = stride. Default: stride = 1. padding (int|tuple): The padding size. If padding is a tuple, it must contain two integers, (padding_H, padding_W). Otherwise, the padding_H = padding_W = padding. Default: padding = 0. dilation (int|tuple): The dilation size. If dilation is a tuple, it must contain two integers, (dilation_H, dilation_W). Otherwise, the dilation_H = dilation_W = dilation. Default: dilation = 1. groups (int): The groups number of the deformable conv layer. According to grouped convolution in Alex Krizhevsky's Deep CNN paper: when group=2, the first half of the filters is only connected to the first half of the input channels, while the second half of the filters is only connected to the second half of the input channels. Default: groups=1. deformable_groups (int): The number of deformable group partitions. Default: deformable_groups = 1. im2col_step (int): Maximum number of images per im2col computation; The total batch size should be devisable by this value or smaller than this value; if you face out of memory problem, you can try to use a smaller value here. Default: im2col_step = 64. param_attr (ParamAttr, Optional): The parameter attribute for learnable parameters/weights of deformable conv. If it is set to None or one attribute of ParamAttr, deformable conv will create ParamAttr as param_attr. If the Initializer of the param_attr is not set, the parameter is initialized with :math:`Normal(0.0, std)`, and the :math:`std` is :math:`(\\frac{2.0 }{filter\_elem\_num})^{0.5}`. Default: None. bias_attr (ParamAttr|bool, Optional): The parameter attribute for the bias of deformable conv layer. If it is set to False, no bias will be added to the output units. If it is set to None or one attribute of ParamAttr, conv2d will create ParamAttr as bias_attr. If the Initializer of the bias_attr is not set, the bias is initialized zero. Default: None. modulated (bool): Make sure which version should be used between v1 and v2, where v2 is \ used while True. Default: True. name(str, Optional): For details, please refer to :ref:`api_guide_Name`. Generally, no setting is required. Default: None. Returns: Tensor: The tensor variable storing the deformable convolution \ result. A Tensor with type float32, float64. Examples: .. code-block:: python >>> # deformable conv v2: >>> import paddle >>> paddle.enable_static() >>> C_in, H_in, W_in = 3, 32, 32 >>> filter_size, deformable_groups = 3, 1 >>> data = paddle.static.data(name='data', shape=[None, C_in, H_in, W_in], dtype='float32') >>> offset = paddle.static.data(name='offset', shape=[None, 2*deformable_groups*filter_size**2, H_in, W_in], dtype='float32') >>> mask = paddle.static.data(name='mask', shape=[None, deformable_groups*filter_size**2, H_in, W_in], dtype='float32') >>> out = paddle.static.nn.common.deformable_conv(input=data, offset=offset, mask=mask, ... num_filters=2, filter_size=filter_size, padding=1, modulated=True) >>> # deformable conv v1: >>> import paddle >>> C_in, H_in, W_in = 3, 32, 32 >>> filter_size, deformable_groups = 3, 1 >>> data = paddle.static.data(name='data', shape=[None, C_in, H_in, W_in], dtype='float32') >>> offset = paddle.static.data(name='offset', shape=[None, 2*deformable_groups*filter_size**2, H_in, W_in], dtype='float32') >>> out = paddle.static.nn.common.deformable_conv(input=data, offset=offset, mask=None, ... num_filters=2, filter_size=filter_size, padding=1, modulated=False) """ check_variable_and_dtype( input, "input", ['float32', 'float64'], 'deformable_conv' ) check_variable_and_dtype( offset, "offset", ['float32', 'float64'], 'deformable_conv' ) check_type( mask, 'mask', (paddle.static.Variable, type(None)), 'deformable_conv' ) if input.ndim != 4: raise ValueError( f'The input should be of [N, C, H, W] format, but received {input.shape}' ) num_channels = input.shape[1] assert param_attr is not False, "param_attr should not be False here." helper = LayerHelper('deformable_conv', **locals()) dtype = helper.input_dtype() if not isinstance(input, paddle.static.Variable): raise TypeError("Input of deformable_conv must be Tensor") if not isinstance(offset, paddle.static.Variable): raise TypeError("Input Offset of deformable_conv must be Tensor") if groups is None: num_filter_channels = num_channels else: if groups == 0: raise ValueError("groups should not be 0.") if num_channels % groups != 0: raise ValueError("num_channels must be divisible by groups.") num_filter_channels = num_channels // groups filter_size = paddle.utils.convert_to_list(filter_size, 2, 'filter_size') stride = paddle.utils.convert_to_list(stride, 2, 'stride') padding = paddle.utils.convert_to_list(padding, 2, 'padding') dilation = paddle.utils.convert_to_list(dilation, 2, 'dilation') input_shape = input.shape filter_shape = [num_filters, int(num_filter_channels), *filter_size] def _get_default_param_initializer(): filter_elem_num = filter_size[0] * filter_size[1] * num_channels if filter_elem_num <= 0: raise ValueError( "Invalid filter number, excepted number is larger than 0, but" f" received {filter_elem_num}, please check the input shape and " "filter size." ) std = (2.0 / filter_elem_num) ** 0.5 return paddle.nn.initializer.normal.Normal(0.0, std) filter_param = helper.create_parameter( attr=helper.param_attr, shape=filter_shape, dtype=dtype, default_initializer=_get_default_param_initializer(), ) pre_bias = helper.create_variable_for_type_inference(dtype) if modulated: helper.append_op( type='deformable_conv', inputs={ 'Input': input, 'Filter': filter_param, 'Offset': offset, 'Mask': mask, }, outputs={"Output": pre_bias}, attrs={ 'strides': stride, 'paddings': padding, 'dilations': dilation, 'groups': groups, 'deformable_groups': deformable_groups, 'im2col_step': im2col_step, }, ) else: helper.append_op( type='deformable_conv_v1', inputs={ 'Input': input, 'Filter': filter_param, 'Offset': offset, }, outputs={"Output": pre_bias}, attrs={ 'strides': stride, 'paddings': padding, 'dilations': dilation, 'groups': groups, 'deformable_groups': deformable_groups, 'im2col_step': im2col_step, }, ) output = helper.append_bias_op(pre_bias, dim_start=1, dim_end=2) return output @static_only def deform_conv2d( x, offset, mask, num_filters, filter_size, stride=1, padding=0, dilation=1, groups=1, deformable_groups=1, im2col_step=1, weight_attr=None, bias_attr=None, name=None, ): r""" Compute 2-D deformable convolution on 4-D input. Given input image x, output feature map y, the deformable convolution operation can be expressed as follow: Deformable Convolution v2: .. math:: y(p) = \sum_{k=1}^{K}{w_k * x(p + p_k + \Delta p_k) * \Delta m_k} Deformable Convolution v1: .. math:: y(p) = \sum_{k=1}^{K}{w_k * x(p + p_k + \Delta p_k)} Where :math:`\Delta p_k` and :math:`\Delta m_k` are the learnable offset and modulation scalar for the k-th location, Which :math:`\Delta m_k` is one in deformable convolution v1. Please refer to `Deformable ConvNets v2: More Deformable, Better Results <path_to_url`_ and `Deformable Convolutional Networks <path_to_url`_. Example: - Input: X shape: :math:`(N, C_{in}, H_{in}, W_{in})` Filter shape: :math:`(C_{out}, C_{in}, H_f, W_f)` Offset shape: :math:`(N, 2 * deformable\_groups * H_f * H_w, H_{in}, W_{in})` Mask shape: :math:`(N, deformable\_groups * H_f * H_w, H_{in}, W_{in})` - Output: Output shape: :math:`(N, C_{out}, H_{out}, W_{out})` Where .. math:: H_{out}&= \frac{(H_{in} + 2 * paddings[0] - (dilations[0] * (H_f - 1) + 1))}{strides[0]} + 1 \\ W_{out}&= \frac{(W_{in} + 2 * paddings[1] - (dilations[1] * (W_f - 1) + 1))}{strides[1]} + 1 Args: x (Tensor): The input image with [N, C, H, W] format. A Tensor with type float32, float64. offset (Tensor): The input coordinate offset of deformable convolution layer. A Tensor with type float32, float64. mask (Tensor): The input mask of deformable convolution layer. A Tensor with type float32, float64. It should be None when you use deformable convolution v1. num_filters(int): The number of filter. It is as same as the output image channel. filter_size (int|list|tuple): The filter size. If filter_size is a list/tuple, it must contain two integers, (filter_size_H, filter_size_W). Otherwise, the filter will be a square. stride (int|list|tuple, Optional): The stride size. If stride is a list/tuple, it must contain two integers, (stride_H, stride_W). Otherwise, the stride_H = stride_W = stride. Default: stride = 1. padding (int|list|tuple, Optional): The padding size. If padding is a list/tuple, it must contain two integers, (padding_H, padding_W). Otherwise, the padding_H = padding_W = padding. Default: padding = 0. dilation (int|list|tuple, Optional): The dilation size. If dilation is a list/tuple, it must contain two integers, (dilation_H, dilation_W). Otherwise, the dilation_H = dilation_W = dilation. Default: dilation = 1. groups (int, Optional): The groups number of the deformable conv layer. According to grouped convolution in Alex Krizhevsky's Deep CNN paper: when group=2, the first half of the filters is only connected to the first half of the input channels, while the second half of the filters is only connected to the second half of the input channels. Default: groups=1. deformable_groups (int, Optional): The number of deformable group partitions. Default: deformable_groups = 1. im2col_step (int, Optional): Maximum number of images per im2col computation; The total batch size should be devisable by this value or smaller than this value; if you face out of memory problem, you can try to use a smaller value here. Default: im2col_step = 1. weight_attr (ParamAttr, Optional): The parameter attribute for learnable parameters/weights of deformable conv. If it is set to None or one attribute of ParamAttr, deformable conv will create ParamAttr as weight_attr. If the Initializer of the weight_attr is not set, the parameter is initialized with :math:`Normal(0.0, std)`, and the :math:`std` is :math:`(\frac{2.0 }{filter\_elem\_num})^{0.5}`. Default: None. bias_attr (ParamAttr|bool, Optional): The parameter attribute for the bias of deformable conv layer. If it is set to False, no bias will be added to the output units. If it is set to None or one attribute of ParamAttr, conv2d will create ParamAttr as bias_attr. If the Initializer of the bias_attr is not set, the bias is initialized zero. Default: None. name(str, Optional): For details, please refer to :ref:`api_guide_Name`. Generally, no setting is required. Default: None. Returns: Tensor: The tensor storing the deformable convolution result. A Tensor with type float32, float64. Examples: .. code-block:: python >>> # deformable conv v2: >>> import paddle >>> paddle.enable_static() >>> C_in, H_in, W_in = 3, 32, 32 >>> filter_size, deformable_groups = 3, 1 >>> data = paddle.static.data(name='data', shape=[None, C_in, H_in, W_in], dtype='float32') >>> offset = paddle.static.data(name='offset', shape=[None, 2*deformable_groups*filter_size**2, H_in, W_in], dtype='float32') >>> mask = paddle.static.data(name='mask', shape=[None, deformable_groups*filter_size**2, H_in, W_in], dtype='float32') >>> out = paddle.static.nn.deform_conv2d(x=data, offset=offset, mask=mask, ... num_filters=2, filter_size=filter_size, padding=1) >>> # deformable conv v1: >>> import paddle >>> paddle.enable_static() >>> C_in, H_in, W_in = 3, 32, 32 >>> filter_size, deformable_groups = 3, 1 >>> data = paddle.static.data(name='data', shape=[None, C_in, H_in, W_in], dtype='float32') >>> offset = paddle.static.data(name='offset', shape=[None, 2*deformable_groups*filter_size**2, H_in, W_in], dtype='float32') >>> out = paddle.static.nn.deform_conv2d(x=data, offset=offset, mask=None, ... num_filters=2, filter_size=filter_size, padding=1) """ if mask is None: return deformable_conv( input=x, offset=offset, mask=mask, num_filters=num_filters, filter_size=filter_size, stride=stride, padding=padding, dilation=dilation, groups=groups, deformable_groups=deformable_groups, im2col_step=im2col_step, param_attr=weight_attr, bias_attr=bias_attr, modulated=False, name=name, ) else: return deformable_conv( input=x, offset=offset, mask=mask, num_filters=num_filters, filter_size=filter_size, stride=stride, padding=padding, dilation=dilation, groups=groups, deformable_groups=deformable_groups, im2col_step=im2col_step, param_attr=weight_attr, bias_attr=bias_attr, modulated=True, name=name, ) def bilinear_tensor_product( x, y, size, act=None, name=None, param_attr=None, bias_attr=None ): r""" This layer performs bilinear tensor product on two inputs. .. math:: out_{i} = x * W_{i} * {y^\mathrm{T}}, i=0,1,...,size-1 In this formula: - :math:`x`: the first input contains M elements, shape is [batch_size, M]. - :math:`y`: the second input contains N elements, shape is [batch_size, N]. - :math:`W_{i}`: the i-th learned weight, shape is [M, N]. - :math:`out_{i}`: the i-th element of out, shape is [batch_size, size]. - :math:`y^\mathrm{T}`: the transpose of :math:`y_{2}`. Args: x (Tensor): 2-D input tensor with shape [batch_size, M]. Data type is float32 or float64. y (Tensor): 2-D input tensor with shape [batch_size, N]. Data type should be same as **x**. size (int): The dimension of this layer. act (str|None): Activation to be applied to the output of this layer. Default None. name(str|None): For detailed information, please refer to :ref:`api_guide_Name` . Usually name is no need to set and None by default. param_attr (ParamAttr|None): To specify the weight parameter attribute. Default: None, which means the default weight parameter property is used. See usage for details in :ref:`api_paddle_ParamAttr` . bias_attr (ParamAttr|None): To specify the bias parameter attribute. Default: None, which means the default bias parameter property is used. See usage for details in :ref:`api_paddle_ParamAttr` . Returns: Tensor, A 2-D Tensor of shape [batch_size, size]. Data type is the same as input **x**. Examples: .. code-block:: python >>> import paddle >>> paddle.enable_static() >>> x = paddle.static.data("t1", shape=[-1, 5], dtype="float32") >>> y = paddle.static.data("t2", shape=[-1, 4], dtype="float32") >>> tensor = paddle.static.nn.bilinear_tensor_product(x, y, size=1000) """ helper = LayerHelper('bilinear_tensor_product', **locals()) dtype = helper.input_dtype('x') if len(x.shape) != 2 or len(y.shape) != 2: raise ValueError( f"Input x and y should be 2D tensor, but received x with the shape of {x.shape}, y with the shape of {y.shape}" ) param_shape = [size, x.shape[1], y.shape[1]] w = helper.create_parameter( attr=helper.param_attr, shape=param_shape, dtype=dtype, is_bias=False ) out = helper.create_variable_for_type_inference(dtype=dtype) inputs = {"X": x, "Y": y, "Weight": w} if helper.bias_attr: bias_size = [1, size] bias = helper.create_parameter( attr=helper.bias_attr, shape=bias_size, dtype=dtype, is_bias=True ) inputs["Bias"] = bias helper.append_op( type="bilinear_tensor_product", inputs=inputs, outputs={"Out": out} ) # add activation return helper.append_activation(out) def batch_norm( input, act=None, is_test=False, momentum=0.9, epsilon=1e-05, param_attr=None, bias_attr=None, data_layout='NCHW', in_place=False, name=None, moving_mean_name=None, moving_variance_name=None, do_model_average_for_mean_and_var=True, use_global_stats=False, ): r""" **Batch Normalization Layer** Can be used as a normalizer function for convolution or fully_connected operations. The required data format for this layer is one of the following: 1. NHWC `[batch, in_height, in_width, in_channels]` 2. NCHW `[batch, in_channels, in_height, in_width]` Refer to `Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift <path_to_url`_ for more details. :math:`input` is the input features over a mini-batch. .. math:: \mu_{\beta} &\gets \frac{1}{m} \sum_{i=1}^{m} x_i \qquad &// \ mini-batch\ mean \\ \sigma_{\beta}^{2} &\gets \frac{1}{m} \sum_{i=1}^{m}(x_i - \mu_{\\beta})^2 \qquad &//\ mini-batch\ variance \\ \hat{x_i} &\gets \frac{x_i - \mu_\beta} {\sqrt{ \sigma_{\beta}^{2} + \epsilon}} \qquad &//\ normalize \\ y_i &\gets \gamma \hat{x_i} + \beta \qquad &//\ scale\ and\ shift moving\_mean = moving\_mean * momentum + mini-batch\_mean * (1. - momentum) \\ moving\_var = moving\_var * momentum + mini-batch\_var * (1. - momentum) moving_mean is global mean and moving_var is global variance. When use_global_stats = True, the :math:`\\mu_{\\beta}` and :math:`\\sigma_{\\beta}^{2}` are not the statistics of one mini-batch. They are global (or running) statistics. (It usually got from the pre-trained model.) The training and testing (or inference) have the same behavior: .. math:: \hat{x_i} &\gets \frac{x_i - \mu_\beta} {\sqrt{ \sigma_{\beta}^{2} + \epsilon}} \\ y_i &\gets \gamma \hat{x_i} + \beta Note: if build_strategy.sync_batch_norm=True, the batch_norm in network will use sync_batch_norm automatically. `is_test = True` can only be used in test program and inference program, `is_test` CANNOT be set to True in train program, if you want to use global status from pre_train model in train program, please set `use_global_stats = True`. Args: input(Tensor): The rank of input Tensor can be 2, 3, 4, 5. The data type is float16 or float32 or float64. act(string, Default None): Activation type, linear|relu|prelu|... is_test (bool, Default False): A flag indicating whether it is in test phrase or not. momentum(float|Tensor, Default 0.9): The value used for the moving_mean and moving_var computation. This should be a float number or a 0-D Tensor with shape [] and data type as float32. The updated formula is: :math:`moving\_mean = moving\_mean * momentum + new\_mean * (1. - momentum)` :math:`moving\_var = moving\_var * momentum + new\_var * (1. - momentum)` Default is 0.9. epsilon(float, Default 1e-05): A value added to the denominator for numerical stability. Default is 1e-5. param_attr(ParamAttr|None): The parameter attribute for Parameter `scale` of batch_norm. If it is set to None or one attribute of ParamAttr, batch_norm will create ParamAttr as param_attr, the name of scale can be set in ParamAttr. If the Initializer of the param_attr is not set, the parameter is initialized with Xavier. Default: None. bias_attr(ParamAttr|None): The parameter attribute for the bias of batch_norm. If it is set to None or one attribute of ParamAttr, batch_norm will create ParamAttr as bias_attr, the name of bias can be set in ParamAttr. If the Initializer of the bias_attr is not set, the bias is initialized zero. Default: None. data_layout (str, optional): Specify the data format of the input, and the data format of the output will be consistent with that of the input. An optional string from: `"NCHW"`, `"NHWC"`. The default is `"NCHW"`. When it is `"NCHW"`, the data is stored in the order of: `[batch_size, input_channels, input_height, input_width]`. in_place(bool, Default False): Make the input and output of batch norm reuse memory. name(str|None): For detailed information, please refer to :ref:`api_guide_Name`. Usually name is no need to set and None by default. moving_mean_name(str, Default None): The name of moving_mean which store the global Mean. If it is set to None, batch_norm will save global mean with a random name, otherwise, batch_norm will save global mean with the string. moving_variance_name(str, Default None): The name of the moving_variance which store the global Variance. If it is set to None, batch_norm will save global variance with a random name, otherwise, batch_norm will save global variance with the string. do_model_average_for_mean_and_var(bool, Default True): Whether parameter mean and variance should do model average when model average is enabled. use_global_stats(bool, Default False): Whether to use global mean and variance. In inference or test mode, set use_global_stats to true or is_test to true, and the behavior is equivalent. In train mode, when setting use_global_stats True, the global mean and variance are also used during train period. Returns: A Tensor which is the result after applying batch normalization on the input, has same shape and data type with input. Examples: .. code-block:: python >>> import paddle >>> paddle.enable_static() >>> x = paddle.static.data(name='x', shape=[3, 7, 3, 7], dtype='float32') >>> hidden1 = paddle.static.nn.fc(x=x, size=200) >>> print(hidden1.shape) (3, 200) >>> hidden2 = paddle.static.nn.batch_norm(input=hidden1) >>> print(hidden2.shape) (3, 200) """ assert ( bias_attr is not False ), "bias_attr should not be False in batch_norm." helper = LayerHelper('batch_norm', **locals()) check_variable_and_dtype( input, 'input', ['uint16', 'float16', 'float32', 'float64'], 'batch_norm', ) dtype = helper.input_dtype() # use fp32 for bn parameter if dtype == paddle.float16 or dtype == paddle.bfloat16: dtype = paddle.float32 input_shape = input.shape if len(input.shape) < 2 or len(input.shape) > 5: raise ValueError( f'expected 2D or 3D or 4D or 5D input (got {len(input.shape)}D input, input shape is: {input_shape})' ) if data_layout == 'NCHW': channel_num = input_shape[1] else: if data_layout == 'NHWC': channel_num = input_shape[-1] else: raise ValueError("unsupported data layout:" + data_layout) param_shape = [channel_num] # create parameter scale = helper.create_parameter( attr=helper.param_attr, shape=param_shape, dtype=dtype, default_initializer=paddle.nn.initializer.Constant(1.0), ) bias = helper.create_parameter( attr=helper.bias_attr, shape=param_shape, dtype=dtype, is_bias=True ) mean = helper.create_parameter( attr=paddle.ParamAttr( name=moving_mean_name, initializer=paddle.nn.initializer.Constant(0.0), trainable=False, do_model_average=do_model_average_for_mean_and_var, ), shape=param_shape, dtype=dtype, ) mean.stop_gradient = True variance = helper.create_parameter( attr=paddle.ParamAttr( name=moving_variance_name, initializer=paddle.nn.initializer.Constant(1.0), trainable=False, do_model_average=do_model_average_for_mean_and_var, ), shape=param_shape, dtype=dtype, ) variance.stop_gradient = True # create output # mean and mean_out share the same memory mean_out = mean # variance and variance_out share the same memory variance_out = variance if in_dygraph_mode(): inputs_has_MomentumTensor = False attrs_has_momentum = False if isinstance(momentum, paddle.Tensor): inputs_has_MomentumTensor = True else: attrs_has_momentum = True attrs_ = () if attrs_has_momentum: attrs_ = ( 'momentum', momentum, 'epsilon', epsilon, 'is_test', is_test, 'data_layout', data_layout, 'fuse_with_relu', False, 'use_global_stats', use_global_stats, ) else: attrs_ = ( 'epsilon', epsilon, 'is_test', is_test, 'data_layout', data_layout, 'fuse_with_relu', False, 'use_global_stats', use_global_stats, ) if inputs_has_MomentumTensor: batch_norm_out, _, _, _, _, _ = paddle._legacy_C_ops.batch_norm( input, scale, bias, mean, variance, momentum, mean_out, variance_out, *attrs_, ) else: batch_norm_out, _, _, _, _, _ = paddle._legacy_C_ops.batch_norm( input, scale, bias, mean, variance, None, mean_out, variance_out, *attrs_, ) return paddle.base.dygraph_utils._append_activation_in_dygraph( batch_norm_out, act=act ) saved_mean = helper.create_variable_for_type_inference( dtype=dtype, stop_gradient=True ) saved_variance = helper.create_variable_for_type_inference( dtype=dtype, stop_gradient=True ) reserve_space = None if not is_test: reserve_space = helper.create_variable_for_type_inference( dtype=helper.input_dtype(), stop_gradient=True ) batch_norm_out = ( input if in_place else helper.create_variable_for_type_inference(dtype) ) inputs = { "X": input, "Scale": scale, "Bias": bias, "Mean": mean, "Variance": variance, "MeanOut": mean_out, "VarianceOut": variance_out, } attrs = { "epsilon": epsilon, "is_test": is_test, "data_layout": data_layout, "fuse_with_relu": False, "use_global_stats": use_global_stats, } if isinstance(momentum, paddle.static.Variable): inputs['MomemtumTensor'] = momentum else: attrs['momentum'] = momentum outputs = { "Y": batch_norm_out, "MeanOut": mean_out, "VarianceOut": variance_out, "SavedMean": saved_mean, "SavedVariance": saved_variance, } if reserve_space is not None: outputs["ReserveSpace"] = reserve_space helper.append_op( type="batch_norm", inputs=inputs, outputs=outputs, attrs=attrs ) return helper.append_activation(batch_norm_out) @static_only def prelu(x, mode, param_attr=None, data_format="NCHW", name=None): r""" prelu activation. .. math:: prelu(x) = max(0, x) + \alpha * min(0, x) There are three modes for the activation: .. code-block:: text all: All elements share same alpha. channel: Elements in same channel share same alpha. element: All elements do not share alpha. Each element has its own alpha. Parameters: x (Tensor): The input Tensor or LoDTensor with data type float32. mode (str): The mode for weight sharing. param_attr (ParamAttr|None, optional): The parameter attribute for the learnable \ weight (alpha), it can be create by ParamAttr. None by default. \ For detailed information, please refer to :ref:`api_paddle_ParamAttr`. data_format(str, optional): Data format that specifies the layout of input. It may be "NC", "NCL", "NCHW", "NCDHW", "NLC", "NHWC" or "NDHWC". Default: "NCHW". name (str, optional): Name for the operation (optional, default is None). \ For more information, please refer to :ref:`api_guide_Name`. Returns: Tensor: A tensor with the same shape and data type as x. Examples: .. code-block:: python >>> import paddle >>> paddle.enable_static() >>> x = paddle.static.data(name="x", shape=[None, 5, 10, 10], dtype="float32") >>> mode = 'channel' >>> output = paddle.static.nn.prelu( ... x,mode,param_attr=paddle.ParamAttr(name='alpha')) """ check_variable_and_dtype(x, 'x', ['float16', 'float32', 'float64'], 'prelu') helper = LayerHelper('prelu', **locals()) if mode not in ['all', 'channel', 'element']: raise ValueError('mode should be one of all, channel, element.') alpha_shape = [1] if mode == 'channel': true_data_format = [ 'NC', 'NCL', 'NCHW', 'NCDHW', 'NLC', 'NHWC', 'NDHWC', ] if data_format not in true_data_format: raise ValueError( "data_format must be one of 'NC', 'NCL', 'NCHW', 'NCDHW', " f"'NLC', 'NHWC', 'NDHWC' but receive {data_format}" ) data_format = 'NCHW' if data_format[1] == 'C' else 'NHWC' assert ( len(x.shape) >= 2 ), "The size of input shape should be equal or larger than 2 in prelu() when mode is 'channel'" # NOTE(zhiqiu): The alpha_shape should be [1, channel] + [1] * len(x.shape[2:]). # To be consistent with Prelu, it is simplified. # NOTE(zhiqiu): Revert shape to [1, channel, 1, 1] for compatibility with saved model of old version. # NOTE(GuoxiaWang): support NHWC data format if data_format == 'NHWC': alpha_shape = [1, 1, 1, x.shape[-1]] else: alpha_shape = [1, x.shape[1], 1, 1] elif mode == 'element': assert ( len(x.shape) >= 1 ), "The size of input shape should be equal or larger than 1 in prelu() when mode is 'element'" alpha_shape = [1] + list(x.shape)[1:] dtype = helper.input_dtype(input_param_name='x') alpha = helper.create_parameter( attr=helper.param_attr, shape=alpha_shape, dtype=dtype, is_bias=False, default_initializer=paddle.nn.initializer.Constant(0.25), ) out = helper.create_variable_for_type_inference(dtype) helper.append_op( type="prelu", inputs={"X": x, 'Alpha': alpha}, attrs={"mode": mode, "data_format": data_format}, outputs={"Out": out}, ) return out class PyFuncRegistry: _register_funcs = [] def __init__(self, func): if func is None or not callable(func): raise TypeError('func must be a Python function') self._func = func # find named args using reflection args = inspect.getfullargspec(self._func) if len(args[0]) == 0 and args[1] is None and args[2] is None: # Function with no inputs self._named_args = None else: self._named_args = args[0] self._id = core._append_python_callable_object_and_return_id(self) ''' Why record self here? 1. For debug usage. Users can call :code:`py_func.registered_func(idx)` method to find the registered function corresponding to :code:`idx`. 2. For increasing reference count of self. It seems that to release Python object whose reference count is 1 would cause segmentation fault error in C++ side. May be lack of Python GC in C++ side? ''' PyFuncRegistry._register_funcs.append(self) @classmethod def registered_func(cls, idx): return cls._register_funcs[idx]._func @classmethod def registered_func_num(cls): return len(cls._register_funcs) @property def id(self): return self._id def __call__(self, *args): if self._named_args is None: func_ret = self._func() else: kwargs = {} idx = 0 for arg in self._named_args: kwargs[arg] = args[idx] idx += 1 func_ret = self._func(*args[idx:], **kwargs) if not isinstance(func_ret, (list, tuple)): func_ret = (func_ret,) ret = [] for each_ret in func_ret: if each_ret is None or isinstance(each_ret, core.LoDTensor): ret.append(each_ret) continue if not isinstance(each_ret, np.ndarray): each_ret = np.array(each_ret) tensor = core.LoDTensor() tensor.set(each_ret, core.CPUPlace()) ret.append(tensor) return tuple(ret) @static_only def py_func(func, x, out, backward_func=None, skip_vars_in_backward_input=None): """ This is used to register customized Python OP to Paddle. The design principe of py_func is that Tensor and numpy array can be converted to each other easily. So you can use Python and numpy API to register a python OP. The forward function of the registered OP is ``func`` and the backward function of that is ``backward_func``. Paddle will call ``func`` at forward runtime and call ``backward_func`` at backward runtime(if ``backward_func`` is not None). ``x`` is the input of ``func``, whose type must be Tensor; ``out`` is the output of ``func``, whose type can be either Tensor or numpy array. The input of the backward function ``backward_func`` is ``x``, ``out`` and the gradient of ``out``. If ``out`` have no gradient, the relevant input of ``backward_func`` is None. If ``x`` do not have a gradient, the user should return None in ``backward_func``. The data type and shape of ``out`` should also be set correctly before this API is called, and the data type and shape of the gradient of ``out`` and ``x`` will be inferred automatically. This API can also be used to debug the neural network by setting the ``func`` as a function that only print variables. Args: func (callable): The forward function of the registered OP. When the network is running, the forward output ``out`` will be calculated according to this function and the forward input ``x``. In ``func`` , it's suggested that we actively convert Tensor into a numpy array, so that we can use Python and numpy API arbitrarily. If not, some operations of numpy may not be compatible. x (Tensor|tuple(Tensor)|list[Tensor]): The input of the forward function ``func``. It can be Tensor|tuple(Tensor)|list[Tensor]. In addition, Multiple Tensor should be passed in the form of tuple(Tensor) or list[Tensor]. out (T|tuple(T)|list[T]): The output of the forward function ``func``, it can be T|tuple(T)|list[T], where T can be either Tensor or numpy array. Since Paddle cannot automatically infer the shape and type of ``out``, you must create ``out`` in advance. backward_func (callable, optional): The backward function of the registered OP. Its default value is None, which means there is no reverse calculation. If it is not None, ``backward_func`` is called to calculate the gradient of ``x`` when the network is at backward runtime. skip_vars_in_backward_input (Tensor, optional): It's used to limit the input list of ``backward_func``, and it can be Tensor|tuple(Tensor)|list[Tensor]. It must belong to either ``x`` or ``out``. The default value is None, which means that no tensors need to be removed from ``x`` and ``out``. If it is not None, these tensors will not be the input of ``backward_func``. This parameter is only useful when ``backward_func`` is not None. Returns: Tensor|tuple(Tensor)|list[Tensor], The output ``out`` of the forward function ``func``. Examples: .. code-block:: python :name: code-example1 >>> import paddle >>> import numpy as np >>> np.random.seed(1107) >>> paddle.seed(1107) >>> paddle.enable_static() >>> # Creates a forward function, Tensor can be input directly without >>> # being converted into numpy array. >>> def tanh(x): ... return np.tanh(x) >>> # Skip x in backward function and return the gradient of x >>> # Tensor must be actively converted to numpy array, otherwise, >>> # operations such as +/- can't be used. >>> def tanh_grad(y, dy): ... return np.array(dy) * (1 - np.square(np.array(y))) >>> # Creates a forward function for debugging running networks(print value) >>> def debug_func(x): ... # print(x) ... pass >>> def create_tmp_var(name, dtype, shape): ... return paddle.static.default_main_program().current_block().create_var( ... name=name, dtype=dtype, shape=shape) >>> def simple_net(img, label): ... hidden = img ... for idx in range(4): ... hidden = paddle.static.nn.fc(hidden, size=200) ... new_hidden = create_tmp_var(name='hidden_{}'.format(idx), ... dtype=hidden.dtype, shape=hidden.shape) ... # User-defined forward and backward ... hidden = paddle.static.py_func(func=tanh, x=hidden, ... out=new_hidden, backward_func=tanh_grad, ... skip_vars_in_backward_input=hidden) ... # User-defined debug functions that print out the input Tensor ... paddle.static.py_func(func=debug_func, x=hidden, out=None) ... prediction = paddle.static.nn.fc(hidden, size=10, activation='softmax') ... ce_loss = paddle.nn.loss.CrossEntropyLoss() ... return ce_loss(prediction, label) >>> x = paddle.static.data(name='x', shape=[1,4], dtype='float32') >>> y = paddle.static.data(name='y', shape=[1], dtype='int64') >>> res = simple_net(x, y) >>> exe = paddle.static.Executor(paddle.CPUPlace()) >>> exe.run(paddle.static.default_startup_program()) >>> input1 = np.random.random(size=[1,4]).astype('float32') >>> input2 = np.random.randint(1, 10, size=[1], dtype='int64') >>> out = exe.run(paddle.static.default_main_program(), ... feed={'x':input1, 'y':input2}, ... fetch_list=[res.name]) >>> print(out[0].shape) () .. code-block:: python :name: code-example2 >>> # This example shows how to turn Tensor into numpy array and >>> # use numpy API to register an Python OP >>> import paddle >>> import numpy as np >>> np.random.seed(1107) >>> paddle.seed(1107) >>> paddle.enable_static() >>> def element_wise_add(x, y): ... # Tensor must be actively converted to numpy array, otherwise, ... # numpy.shape can't be used. ... x = np.array(x) ... y = np.array(y) ... if x.shape != y.shape: ... raise AssertionError("the shape of inputs must be the same!") ... result = np.zeros(x.shape, dtype='int32') ... for i in range(len(x)): ... for j in range(len(x[0])): ... result[i][j] = x[i][j] + y[i][j] ... return result >>> def create_tmp_var(name, dtype, shape): ... return paddle.static.default_main_program().current_block().create_var( ... name=name, dtype=dtype, shape=shape) >>> def py_func_demo(): ... start_program = paddle.static.default_startup_program() ... main_program = paddle.static.default_main_program() ... # Input of the forward function ... x = paddle.static.data(name='x', shape=[2, 3], dtype='int32') ... y = paddle.static.data(name='y', shape=[2, 3], dtype='int32') ... # Output of the forward function, name/dtype/shape must be specified ... output = create_tmp_var('output','int32', [3, 1]) ... # Multiple Tensor should be passed in the form of tuple(Tensor) or list[Tensor] ... paddle.static.py_func(func=element_wise_add, x=[x, y], out=output) ... exe=paddle.static.Executor(paddle.CPUPlace()) ... exe.run(start_program) ... # Feed numpy array to main_program ... input1 = np.random.randint(1, 10, size=[2, 3], dtype='int32') ... input2 = np.random.randint(1, 10, size=[2, 3], dtype='int32') ... out = exe.run(main_program, ... feed={'x':input1, 'y':input2}, ... fetch_list=[output.name]) ... print("{0} + {1} = {2}".format(input1, input2, out)) >>> py_func_demo() >>> # [[1 5 4] + [[3 7 7] = [array([[ 4, 12, 11] >>> # [9 4 8]] [2 3 9]] [11, 7, 17]], dtype=int32)] """ helper = LayerHelper('py_func', **locals()) check_type(x, 'X', (list, tuple, Variable, type(None)), 'py_func') if x is None: x = [] elif isinstance(x, Variable): x = [x] elif isinstance(x, tuple): x = list(x) elif not isinstance(x, (list, tuple, Variable)): raise TypeError('Input must be Tensor/list(Tensor)/tuple(Tensor)') check_type(out, 'Out', (list, tuple, Variable, type(None)), 'py_func') if out is None: out_list = [] elif isinstance(out, Variable): out_list = [out] elif isinstance(out, tuple): out_list = list(out) elif isinstance(out, list): out_list = out else: raise TypeError('Output must be Tensor/list(Tensor)/tuple(Tensor)') fwd_func_id = PyFuncRegistry(func).id bwd_func_id = ( PyFuncRegistry(backward_func).id if backward_func is not None else -1 ) for each_out in out_list: if len(each_out.shape) == 0: raise ValueError( 'Output shapes of py_func should be provided by users manually' ) backward_skip_vars = set() if backward_func is not None and skip_vars_in_backward_input is not None: if isinstance(skip_vars_in_backward_input, Variable): skip_vars_in_backward_input = [skip_vars_in_backward_input] fwd_in_out = [v.name for v in x] fwd_in_out.extend([v.name for v in out_list]) fwd_in_out = set(fwd_in_out) backward_skip_vars = set() for v in skip_vars_in_backward_input: if v.name not in fwd_in_out: raise ValueError( f'Tensor {v.name} is not found in forward inputs and outputs' ) backward_skip_vars.add(v.name) helper.append_op( type='py_func', inputs={'X': x}, outputs={'Out': out_list}, attrs={ 'forward_callable_id': fwd_func_id, 'backward_callable_id': bwd_func_id, 'backward_skip_vars': list(backward_skip_vars), }, ) return out def row_conv(input, future_context_size, param_attr=None, act=None): r""" :api_attr: Static Graph The row convolution is called lookahead convolution. It was introduced in the following paper for DeepSpeech2: path_to_url~dyogatam/papers/wang+etal.iclrworkshop2016.pdf The main motivation is that a bidirectional RNN, useful in DeepSpeech like speech models, learns representation for a sequence by performing a forward and a backward pass through the entire sequence. However, unlike unidirectional RNNs, bidirectional RNNs are challenging to deploy in an online and low-latency setting. The lookahead convolution incorporates information from future subsequences in a computationally efficient manner to improve unidirectional recurrent neural networks. The row convolution is different from the 1D sequence convolution, and is computed as follows: Given an input sequence :math:`X` of length :math:`t` and input dimension :math:`D`, and a filter (:math:`W`) of size :math:`context \times D`, the output sequence is convolved as: .. math:: Out_{i} = \sum_{j=i}^{i + context - 1} X_{j} \cdot W_{j-i} In the above equation: * :math:`Out_{i}`: The i-th row of output variable with shape [1, D]. * :math:`context`: Future context size. * :math:`X_{j}`: The j-th row of input variable with shape [1, D]. * :math:`W_{j-i}`: The (j-i)-th row of parameters with shape [1, D]. More details about row_conv please refer to the design document path_to_url#issuecomment-303903645 . Args: input (Tensor): The input is a Tensor, the shape of Tensor input has shape (B x T x N), B is batch size. future_context_size (int): Future context size. Please note, the shape of convolution kernel is [future_context_size + 1, D]. param_attr (ParamAttr): Attributes of parameters, including name, initializer etc. act (str): Non-linear activation to be applied to output Tensor. Returns: Tensor: The output is a Tensor, which has same type and same shape as input. Examples: .. code-block:: python >>> # for LodTensor inputs >>> import paddle >>> paddle.enable_static() >>> x = paddle.static.data(name='x', shape=[9, 16], ... dtype='float32', lod_level=1) >>> out_x = paddle.static.nn.row_conv(input=x, future_context_size=2) >>> # for Tensor inputs >>> y = paddle.static.data(name='y', shape=[9, 4, 16], dtype='float32') >>> out_y = paddle.static.nn.row_conv(input=y, future_context_size=2) """ helper = LayerHelper('row_conv', **locals()) check_variable_and_dtype(input, 'input', ['float32'], 'row_conv') dtype = helper.input_dtype() filter_shape = [future_context_size + 1, input.shape[-1]] filter_param = helper.create_parameter( attr=helper.param_attr, shape=filter_shape, dtype=dtype ) out = helper.create_variable_for_type_inference(dtype) helper.append_op( type='row_conv', inputs={'X': [input], 'Filter': [filter_param]}, outputs={'Out': [out]}, ) return helper.append_activation(out) def spectral_norm(weight, dim=0, power_iters=1, eps=1e-12, name=None): r""" :api_attr: Static Graph **Spectral Normalization Layer** This operation calculates the spectral normalization value of weight parameters of fc, conv1d, conv2d, conv3d layers which should be 2-D, 3-D, 4-D, 5-D Parameters. Output tensor will be in same shape with input tensor. Calculations are showed as follows. Step 1: Generate vector U in shape of [H], and V in shape of [W]. While H is the :attr:`dim` th dimension of the input weights, and W is the product result of remaining dimensions. Step 2: :attr:`power_iters` should be a positive integer, do following calculations with U and V for :attr:`power_iters` rounds. Calculations as follows: .. math:: \mathbf{v} := \\frac{\mathbf{W}^{T} \mathbf{u}}{\|\mathbf{W}^{T} \mathbf{u}\|_2} \mathbf{u} := \\frac{\mathbf{W}^{T} \mathbf{v}}{\|\mathbf{W}^{T} \mathbf{v}\|_2} Step 3: Calculate :math:`\sigma(\mathbf{W})` and normalize weight values. .. math:: \sigma(\mathbf{W}) = \mathbf{u}^{T} \mathbf{W} \mathbf{v} \mathbf{W} = \\frac{\mathbf{W}}{\sigma(\mathbf{W})} Refer to `Spectral Normalization <path_to_url`_ . Args: weight(Tensor): The input weight tensor of spectral_norm operator, This can be a 2-D, 3-D, 4-D, 5-D tensor which is the weights of fc, conv1d, conv2d, conv3d layer. The data type is float32 or float64. dim(int): The index of dimension which should be permuted to the first before reshaping Input(Weight) to matrix, it should be set as 0 if Input(Weight) is the weight of fc layer, and should be set as 1 if Input(Weight) is the weight of conv layer, default 0. power_iters(int): number of power iterations to calculate spectral norm, default 1. eps(float): epsilon for numerical stability in calculating norms, it will be added to the denominator to avoid divide zero. Default 1e-12. name(str, optional): For detailed information, please refer to :ref:`api_guide_Name`. Usually name is no need to set and None by default. Returns: Tensor: A tensor of weight parameters after spectral normalization. The data type and shape is same as input tensor. Examples: .. code-block:: python >>> import paddle >>> paddle.enable_static() >>> weight = paddle.static.data(name='weight', shape=[2, 8, 32, 32], dtype='float32') >>> x = paddle.static.nn.spectral_norm(weight=weight, dim=1, power_iters=2) >>> print(x.shape) (2, 8, 32, 32) """ helper = LayerHelper('spectral_norm', **locals()) check_variable_and_dtype( weight, 'weight', ['float32', 'float64'], 'spectral_norm' ) check_type(dim, 'dim', int, 'spectral_norm') check_type(power_iters, 'power_iters', int, 'spectral_norm') check_type(eps, 'eps', float, 'spectral_norm') dtype = weight.dtype # create input and parameters input_shape = weight.shape assert weight.numel() > 0, "Any dimension of input cannot be equal to 0." if dim not in [0, 1]: raise ValueError( f"The input `dim` must be 0 (if weight in fc) or 1 (if weight in conv), but received dim={dim}" ) h = input_shape[dim] w = np.prod(input_shape) // h u = helper.create_parameter( attr=ParamAttr(), shape=[h], dtype=dtype, default_initializer=Normal(0.0, 1.0), ) u.stop_gradient = True v = helper.create_parameter( attr=ParamAttr(), shape=[w], dtype=dtype, default_initializer=Normal(0.0, 1.0), ) v.stop_gradient = True if in_dynamic_or_pir_mode(): return paddle._C_ops.spectral_norm(weight, u, v, dim, power_iters, eps) inputs = {'Weight': weight} inputs['U'] = u inputs['V'] = v # create output out = helper.create_variable(dtype=dtype) helper.append_op( type="spectral_norm", inputs=inputs, outputs={ "Out": out, }, attrs={ "dim": dim, "power_iters": power_iters, "eps": eps, }, ) return out # For debug usage py_func.registered_func = PyFuncRegistry.registered_func py_func.registered_func_num = PyFuncRegistry.registered_func_num def layer_norm( input, scale=True, shift=True, begin_norm_axis=1, epsilon=1e-05, param_attr=None, bias_attr=None, act=None, name=None, ): r""" **Layer Normalization Layer** The API implements the function of the Layer Normalization Layer and can be applied to mini-batch input data. Refer to `Layer Normalization <path_to_url`_ The formula is as follows: .. math:: \mu & = \frac{1}{H}\sum_{i=1}^{H} x_i \sigma & = \sqrt{\frac{1}{H}\sum_{i=1}^{H}{(x_i - \mu)^2} + \epsilon} y & = f(\frac{g}{\sigma}(x - \mu) + b) - :math:`x`: the vector representation of the summed inputs to the neurons in that layer. - :math:`H`: the number of hidden units in a layers - :math:`\\epsilon`: the small value added to the variance to prevent division by zero. - :math:`g`: the trainable scale parameter. - :math:`b`: the trainable bias parameter. Args: input(Tensor): A multi-dimension ``Tensor`` , and the data type is float32 or float64. scale(bool, optional): Whether to learn the adaptive gain :math:`g` after normalization. Default: True. shift(bool, optional): Whether to learn the adaptive bias :math:`b` after normalization. Default: True. begin_norm_axis(int, optional): The normalization will be performed along dimensions from :attr:`begin_norm_axis` to :attr:`rank(input)`. Default: 1. epsilon(float, optional): The small value added to the variance to prevent division by zero. Default: 1e-05. param_attr(ParamAttr, optional): The parameter attribute for the learnable gain :math:`g`. If :attr:`scale` is False, :attr:`param_attr` is omitted. If :attr:`scale` is True and :attr:`param_attr` is None, a default :code:`ParamAttr` would be added as scale. The :attr:`param_attr` is initialized as 1 if it is added. Default: None. bias_attr(ParamAttr, optional): The parameter attribute for the learnable bias :math:`b`. If :attr:`shift` is False, :attr:`bias_attr` is omitted. If :attr:`shift` is True and :attr:`param_attr` is None, a default :code:`ParamAttr` would be added as bias. The :attr:`bias_attr` is initialized as 0 if it is added. Default: None. act(str, optional): Activation to be applied to the output of layer normalization. Default: None. name(str, optional): The default value is None. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name` . Returns: Tensor: ``Tensor`` indicating the normalized result, the data type is the same as ``input`` , and the return dimension is the same as ``input`` . Examples: .. code-block:: python >>> import paddle >>> paddle.enable_static() >>> x = paddle.static.data(name='x', shape=[8, 32, 32], dtype='float32') >>> output = paddle.static.nn.layer_norm(input=x, begin_norm_axis=1) >>> print(output.shape) (8, 32, 32) """ assert ( in_dygraph_mode() is not True ), "please use LayerNorm instead of layer_norm in dygraph mode!" helper = LayerHelper('layer_norm', **locals()) check_variable_and_dtype( input, 'input', ['float32', 'float64'], 'layer_norm' ) dtype = helper.input_dtype() # create input and parameters inputs = {'X': input} input_shape = input.shape param_shape = [reduce(lambda x, y: x * y, input_shape[begin_norm_axis:], 1)] if scale: assert ( param_attr is not False ), "param_attr should not be False when using scale." scale = helper.create_parameter( attr=helper.param_attr, shape=param_shape, dtype=dtype, default_initializer=Constant(1.0), ) inputs['Scale'] = scale else: if param_attr: warnings.warn("param_attr is only available with scale is True.") if shift: assert ( bias_attr is not False ), "bias_attr should not be False when using shift." bias = helper.create_parameter( attr=helper.bias_attr, shape=param_shape, dtype=dtype, is_bias=True ) inputs['Bias'] = bias else: if bias_attr: warnings.warn("bias_attr is only available with shift is True.") # create output mean_out = helper.create_variable_for_type_inference( dtype=dtype, stop_gradient=True ) variance_out = helper.create_variable_for_type_inference( dtype=dtype, stop_gradient=True ) layer_norm_out = helper.create_variable_for_type_inference(dtype) helper.append_op( type="layer_norm", inputs=inputs, outputs={ "Y": layer_norm_out, "Mean": mean_out, "Variance": variance_out, }, attrs={"epsilon": epsilon, "begin_norm_axis": begin_norm_axis}, ) return helper.append_activation(layer_norm_out) @static_only def embedding( input, size, is_sparse=False, is_distributed=False, padding_idx=None, param_attr=None, dtype='float32', ): r""" :api_attr: Static Graph The operator is used to lookup embeddings vector of ids provided by :attr:`input` . It automatically constructs a 2D embedding matrix based on the input :attr:`size` (vocab_size, emb_size) and :attr:`dtype` . The shape of output Tensor is generated by appending an emb_size dimension to the last dimension of the input Tensor shape. **Note:** The id in :attr:`input` must satisfy :math:`0 =< id < size[0]` , otherwise the program will throw an exception and exit. .. code-block:: text Case 1: input is a Tensor. padding_idx = -1 input.data = [[1, 3], [2, 4], [4, 127]] input.shape = [3, 2] Given size = [128, 16] output is a Tensor: out.shape = [3, 2, 16] out.data = [[[0.129435295, 0.244512452, ..., 0.436322452], [0.345421456, 0.524563927, ..., 0.144534654]], [[0.345249859, 0.124939536, ..., 0.194353745], [0.945345345, 0.435394634, ..., 0.435345365]], [[0.945345345, 0.435394634, ..., 0.435345365], [0.0, 0.0, ..., 0.0 ]]] # padding data The input padding_idx is less than 0, it is automatically converted to padding_idx = -1 + 128 = 127 It will pad all-zero data when ids is 127. Case 2: input is a LoDTensor with 1-level LoD. padding_idx = 0 input.lod = [[2, 3]] input.data = [[1], [3], [2], [4], [0]] input.shape = [5, 1] Given size = [128, 16] output is a LoDTensor: out.lod = [[2, 3]] out.shape = [5, 1, 16] out.data = [[[0.129435295, 0.244512452, ..., 0.436322452]], [[0.345421456, 0.524563927, ..., 0.144534654]], [[0.345249859, 0.124939536, ..., 0.194353745]], [[0.945345345, 0.435394634, ..., 0.435345365]], [[0.0, 0.0, ..., 0.0 ]]] # padding data It will pad all-zero data when ids is 0. Args: input(Tensor): A Tensor or LoDTensor with type int64, which contains the id information. The value of the input id should satisfy :math:`0<= id < size[0]` . size(tuple|list): The shape of lookup table parameter. It should have two elements which indicates the size of the dictionary of embeddings and the size of each embedding vector respectively. is_sparse(bool): The flag indicating whether to use sparse update. This parameter only affects the performance of the backwards gradient update. It is recommended to set True because sparse update is faster. But some optimizer does not support sparse update In these case, is_sparse must be False. Default: False. is_distributed(bool): Whether to store the embedding matrix in a distributed manner. Only used in multi-machine distributed CPU training. Default: False. padding_idx(int|long|None): padding_idx needs to be in the interval [-vocab_size, vocab_size). If :math:`padding\_idx < 0`, the :math:`padding\_idx` will automatically be converted to :math:`vocab\_size + padding\_idx` . It will output all-zero padding data whenever lookup encounters :math:`padding\_idx` in id. And the padding data will not be updated while training. If set None, it makes no effect to output. Default: None. param_attr(ParamAttr): To specify the weight parameter property. Default: None, which means the default weight parameter property is used. In addition, user-defined or pre-trained word vectors can be loaded with the :attr:`param_attr` parameter. The local word vector needs to be transformed into numpy format, and the shape of local word vector should be consistent with :attr:`size` . dtype(str): It refers to the data type of output Tensor. It must be float32 or float64. Default: float32. Returns: Tensor: Embedding Tensor or LoDTensor mapped by input. The data type is the same as :attr:`dtype` . Static Examples: .. code-block:: python >>> import paddle >>> import numpy as np >>> paddle.enable_static() >>> x = paddle.static.data(name="x", shape = [2, 4], dtype=np.int64) >>> output = paddle.static.nn.embedding(x, (10, 3), ... param_attr=paddle.nn.initializer.Constant(value=1.0)) >>> m_output=paddle.mean(output) >>> place = paddle.CPUPlace() >>> exe = paddle.static.Executor(place) >>> exe.run(paddle.static.default_startup_program()) >>> x = np.array([[7, 2, 4, 5],[4, 3, 2, 9]], dtype=np.int64) # type: ignore[var-annotated] >>> out, = exe.run(paddle.static.default_main_program(), feed={'x':x}, fetch_list=[output]) >>> print(out) [[[1. 1. 1.] [1. 1. 1.] [1. 1. 1.] [1. 1. 1.]] [[1. 1. 1.] [1. 1. 1.] [1. 1. 1.] [1. 1. 1.]]] """ helper = LayerHelper('embedding', **locals()) check_variable_and_dtype(input, 'input', ['int64'], 'embedding') check_dtype( dtype, 'dtype', ['float16', 'float32', 'float64', 'uint16'], 'embedding', ) remote_prefetch = is_sparse and (not is_distributed) if remote_prefetch: assert is_sparse is True and is_distributed is False w = helper.create_parameter( attr=helper.param_attr, shape=size, dtype=dtype, is_bias=False ) tmp = helper.create_variable_for_type_inference(dtype) padding_idx = ( -1 if padding_idx is None else padding_idx if padding_idx >= 0 else (size[0] + padding_idx) ) helper.append_op( type='lookup_table_v2', inputs={'Ids': input, 'W': w}, outputs={'Out': tmp}, attrs={ 'is_sparse': is_sparse, 'is_distributed': is_distributed, 'remote_prefetch': remote_prefetch, 'padding_idx': padding_idx, }, ) return tmp def sparse_embedding( input, size, padding_idx=None, is_test=False, entry=None, table_class="MemorySparseTable", param_attr=None, dtype='float32', slot=None, ): r""" :api_attr: Static Graph The OP is used as the operator of the Embedding Lookup layer in the large-scale sparse training of the parameter server mode, instead of using the paddle.nn.functional.embedding. The operator is used to lookup embeddings vector of ids provided by :attr:`input` . It automatically constructs a 2D embedding matrix based on the input :attr:`size` (vocab_size, emb_size) and :attr:`dtype` . The shape of output Tensor is generated by appending an emb_size dimension to the last dimension of the input Tensor shape. **Note:** The id in :attr:`input` must satisfy :math:`0 =< id < size[0]` , otherwise the program will throw an exception and exit. .. code-block:: text Case 1: input is a Tensor. padding_idx = -1 input.data = [[1, 3], [2, 4], [4, 127]] input.shape = [3, 2] Given size = [128, 16] output is a Tensor: out.shape = [3, 2, 16] out.data = [[[0.129435295, 0.244512452, ..., 0.436322452], [0.345421456, 0.524563927, ..., 0.144534654]], [[0.345249859, 0.124939536, ..., 0.194353745], [0.945345345, 0.435394634, ..., 0.435345365]], [[0.945345345, 0.435394634, ..., 0.435345365], [0.0, 0.0, ..., 0.0 ]]] # padding data The input padding_idx is less than 0, it is automatically converted to padding_idx = -1 + 128 = 127 It will pad all-zero data when ids is 127. Case 2: input is a LoDTensor with 1-level LoD. padding_idx = 0 input.lod = [[2, 3]] input.data = [[1], [3], [2], [4], [0]] input.shape = [5, 1] Given size = [128, 16] output is a LoDTensor: out.lod = [[2, 3]] out.shape = [5, 1, 16] out.data = [[[0.129435295, 0.244512452, ..., 0.436322452]], [[0.345421456, 0.524563927, ..., 0.144534654]], [[0.345249859, 0.124939536, ..., 0.194353745]], [[0.945345345, 0.435394634, ..., 0.435345365]], [[0.0, 0.0, ..., 0.0 ]]] # padding data It will pad all-zero data when ids is 0. Args: input(Tensor): A Tensor or LoDTensor with type int64, which contains the id information. The value of the input id should satisfy :math:`0<= id < size[0]` . size(tuple|list): The shape of lookup table parameter (vocab_size, emb_size). It should have two elements which indicates the size of the dictionary of embeddings and the size of each embedding vector respectively. The initial parameter size is 0 in the large-scale sparse scenario, which will gradually expand with the training. So if vocab_size is temporarily useless, its value can be any integer. The emb_size is the dimensional configuration of the word embedding weight parameter. padding_idx(int|long|None, optional): padding_idx needs to be in the interval [-vocab_size, vocab_size). If :math:`padding\_idx < 0`, the :math:`padding\_idx` will automatically be converted to :math:`vocab\_size + padding\_idx` . It will output all-zero padding data whenever lookup encounters :math:`padding\_idx` in id. And the padding data will not be updated while training. If set None, it makes no effect to output. Default: None. is_test(bool, optional): Training or prediction mode. In prediction mode (is_test=False), the output is not initialized and created, and it is filled with 0 and returned. Default: False. entry(str, optional): Entry config with parameter server whose value is ProbabilityEntry, CountFilterEntry or None. Default: None. table_class(str, optional): The type of the sparse table. The value can be CommonSparseTable or SSDSparseTable. The default is CommonSparseTable. param_attr(ParamAttr, optional): To specify the weight parameter property. Default: None, which means the default weight parameter property is used. In addition, user-defined or pre-trained word vectors can be loaded with the :attr:`param_attr` parameter. The local word vector needs to be transformed into numpy format, and the shape of local word vector should be consistent with :attr:`size` . dtype(str): It refers to the data type of output Tensor. It must be float32 or float64. Default: float32. Returns: Tensor: Embedding Tensor or LoDTensor mapped by input. The data type is the same as :attr:`dtype` . Examples: .. code-block:: python >>> import paddle >>> paddle.enable_static() >>> sparse_feature_dim = 1024 >>> embedding_size = 64 >>> # Only when the feature appear more than 10 times or more will be participated in the training. >>> entry = paddle.distributed.CountFilterEntry(10) >>> input = paddle.static.data(name='ins', shape=[1], dtype='int64') >>> emb = paddle.static.nn.sparse_embedding( ... input=input, ... size=[sparse_feature_dim, embedding_size], ... is_test=False, ... entry=entry, ... param_attr=paddle.ParamAttr(name="SparseFeatFactors", ... initializer=paddle.nn.initializer.Uniform())) """ helper = LayerHelper('sparse_embedding', **locals()) check_variable_and_dtype( input, 'input', ['int64'], 'paddle.incubate.layers.sparse_embedding' ) check_dtype( dtype, 'dtype', ['float32', 'float64'], 'paddle.static.nn.sparse_embedding', ) if input.size == 0: raise ValueError("input size should not be 0") w = helper.create_parameter( attr=helper.param_attr, shape=size, type=core.VarDesc.VarType.SELECTED_ROWS, dtype=dtype, is_bias=False, ) tmp = helper.create_variable_for_type_inference(dtype) padding_idx = ( -1 if padding_idx is None else padding_idx if padding_idx >= 0 else (size[0] + padding_idx) ) if table_class not in [ "CommonSparseTable", "SSDSparseTable", "MemorySparseTable", ]: raise ValueError( "table_class must be in [CommonSparseTable, SSDSparseTable, MemorySparseTable]" ) entry_str = "none" if entry is not None: if entry.__class__.__name__ not in [ "ProbabilityEntry", "CountFilterEntry", "ShowClickEntry", ]: raise ValueError( "entry must be instance in [paddle.distributed.ProbabilityEntry, paddle.distributed.CountFilterEntry, paddle.distributed.ShowClickEntry]" ) entry_str = entry._to_attr() if slot is None: slot = 0 helper.append_op( type='lookup_table', inputs={'Ids': input, 'W': w}, outputs={'Out': tmp}, attrs={ 'padding_idx': padding_idx, 'is_sparse': True, 'is_distributed': True, 'remote_prefetch': True, 'is_test': is_test, 'entry': entry_str, 'table_class': table_class, 'slot': slot, }, ) return tmp class ExponentialMovingAverage: r""" Compute the moving average of parameters with exponential decay. Given a parameter :math:`\\theta`, its exponential moving average (EMA) will be .. math:: \text{EMA}_0 & = 0 \text{EMA}_t & = \text{decay} * \text{EMA}_{t-1} + (1 - \text{decay}) * \theta_t The average results calculated by **update()** method will be saved in temporary variables which are created and maintained by the object, and can be applied to parameters of current model by calling **apply()** method. And the **restore()** method is used to restore the parameters. **Bias correction**. All EMAs are initialized to :math:`0` and hence they will be zero biased, which can be corrected by divided by a factor :math:`(1 - \text{decay}^t)` , i.e., the actual EMAs applied to parameters when calling **apply()** method would be .. math:: \widehat{\text{EMA}}_t = \frac{\text{EMA}_t}{1 - \text{decay}^t} **Decay rate scheduling**. A large decay rate very close to 1 would result in that the averages move very slowly. And a better strategy is to set a relative smaller decay rate in the very beginning. The argument **thres_steps** allows users to pass a Variable to schedule the decay rate, in this case, the actual decay rate becomes .. math:: \min(\text{decay}, \frac{1 + \text{thres_steps}}{10 + \text{thres_steps}}) Usually **thres_steps** can be the global training steps. Args: decay (float, optional): The exponential decay rate, usually close to 1, such as 0.999, 0.9999, ... . Default 0.999. thres_steps (Variable|None, optional): If not `None`, schedule the decay rate. Default None. name (str|None, optional): For detailed information, please refer to :ref:`api_guide_Name`. Usually name is no need to set and None by default. Examples: .. code-block:: python >>> import numpy >>> import paddle >>> import paddle.static as static >>> from paddle.static import ExponentialMovingAverage >>> paddle.enable_static() >>> data = static.data(name='x', shape=[-1, 5], dtype='float32') >>> hidden = static.nn.fc(x=data, size=10) >>> cost = paddle.mean(hidden) >>> test_program = static.default_main_program().clone(for_test=True) >>> optimizer = paddle.optimizer.Adam(learning_rate=0.001) >>> optimizer.minimize(cost) >>> ema = ExponentialMovingAverage(0.999) >>> ema.update() >>> place = paddle.CPUPlace() >>> exe = static.Executor(place) >>> exe.run(static.default_startup_program()) >>> for pass_id in range(3): ... for batch_id in range(6): ... feed_data = numpy.random.random(size=(10, 5)).astype('float32') ... exe.run(program=static.default_main_program(), ... feed={'x': feed_data}, ... fetch_list=[cost.name]) ... # usage 1 ... with ema.apply(exe): ... feed_data = numpy.random.random(size=(10, 5)).astype('float32') ... exe.run(program=test_program, ... feed={'x': feed_data}, ... fetch_list=[hidden.name]) ... # usage 2 ... with ema.apply(exe, need_restore=False): ... feed_data = numpy.random.random(size=(10, 5)).astype('float32') ... exe.run(program=test_program, ... feed={'x': feed_data}, ... fetch_list=[hidden.name]) ... ema.restore(exe) """ def __init__(self, decay=0.999, thres_steps=None, name=None): if in_dygraph_mode(): raise Exception( "In dygraph, don't support ExponentialMovingAverage." ) self._decay = decay self._thres_steps = thres_steps self._name = name if name is not None else '' self._decay_var = self._get_ema_decay() self._step_counter_name = "@EMA_STEP_COUNTER@" self._params_tmps = [] for param in default_main_program().global_block().all_parameters(): if param.do_model_average: tmp = param.block.create_var( name=unique_name.generate( ".".join([self._name + param.name, 'ema_tmp']) ), dtype=param.dtype, persistable=False, stop_gradient=True, ) self._params_tmps.append((param, tmp)) self._ema_vars = {} for param, tmp in self._params_tmps: with param.block.program._optimized_guard([param, tmp]), name_scope( 'moving_average' ): self._ema_vars[param.name] = self._create_ema_vars(param) self.apply_program = Program() block = self.apply_program.global_block() with program_guard(main_program=self.apply_program): decay_pow, global_step = self._get_decay_pow(block) for param, tmp in self._params_tmps: param = block._clone_variable(param) tmp = block._clone_variable(tmp) ema = block._clone_variable(self._ema_vars[param.name]) paddle.assign(param, output=tmp) # bias correction param_val = paddle.static.nn.cond( global_step > 0, lambda: ema / (1.0 - decay_pow), lambda: ema, ) paddle.assign(param_val, output=param) self.restore_program = Program() block = self.restore_program.global_block() with program_guard(main_program=self.restore_program): for param, tmp in self._params_tmps: tmp = block._clone_variable(tmp) param = block._clone_variable(param) paddle.assign(tmp, output=param) def _get_ema_decay(self): with default_main_program()._lr_schedule_guard(): decay_var = paddle.static.create_global_var( shape=[1], value=self._decay, dtype='float32', persistable=True, name="scheduled_ema_decay_rate", ) if self._thres_steps is not None: decay_t = (self._thres_steps + 1.0) / (self._thres_steps + 10.0) decay_val = paddle.static.nn.cond( decay_t < self._decay, lambda: decay_t, lambda: np.array([self._decay], dtype=np.float32), ) paddle.assign(decay_val, decay_var) return decay_var def _get_decay_pow(self, block): global_step = paddle.static.create_global_var( name=self._step_counter_name, shape=[1], value=0, dtype='int64', persistable=True, ) global_step = paddle.cast(global_step, "float32") decay_var = block._clone_variable(self._decay_var) decay_pow_acc = paddle.pow(decay_var, global_step) return decay_pow_acc, global_step def _create_ema_vars(self, param): param_ema = paddle.static.create_global_var( name=unique_name.generate(self._name + param.name + '_ema'), shape=param.shape, value=0.0, dtype=param.dtype, persistable=True, ) return param_ema def update(self): """ Update Exponential Moving Average. Should only call this method in train program. """ global_step = paddle.optimizer.lr.autoincreased_step_counter( counter_name=self._step_counter_name ) param_master_emas = [] for param, tmp in self._params_tmps: with param.block.program._optimized_guard([param, tmp]), name_scope( 'moving_average' ): param_ema = self._ema_vars[param.name] if param.name + '.master' in self._ema_vars: master_ema = self._ema_vars[param.name + '.master'] param_master_emas.append([param_ema, master_ema]) else: ema_t = param_ema * self._decay_var + param * ( 1 - self._decay_var ) paddle.assign(ema_t, output=param_ema) # for fp16 params for param_ema, master_ema in param_master_emas: default_main_program().global_block().append_op( type="cast", inputs={"X": master_ema}, outputs={"Out": param_ema}, attrs={ "in_dtype": master_ema.dtype, "out_dtype": param_ema.dtype, }, ) @signature_safe_contextmanager def apply(self, executor, need_restore=True): """ Apply moving average to parameters for evaluation. Args: executor (Executor): The Executor to execute applying. need_restore (bool, optional): Whether to restore parameters after applying. Default True. """ executor.run(self.apply_program) try: yield finally: if need_restore: self.restore(executor) def restore(self, executor): """Restore parameters. Args: executor (Executor): The Executor to execute restoring. """ executor.run(self.restore_program) ```
The 3rd 10 Hours of Messina was a sports car race, held on 25 July 1954 in the street circuit of Messina, Italy. Final standings Started: 39 Classified: 23 See also Messina Grand Prix (auto race that replaced it) References External links Ai fratelli Sgorbati la "10 ore" di Messina at Istituto Luce archive La 10 Ore di Messina, la storia 10 Hours of Messina
Okpometa is an arrondissement in the Plateau department of Benin. It is an administrative division under the jurisdiction of the commune of Kétou. According to the population census conducted by the Institut National de la Statistique Benin on February 15, 2002, the arrondissement had a total population of 7,822. References Populated places in the Plateau Department Arrondissements of Benin
```smalltalk using System; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Logging; using Ombi.Api.Webhook; using Ombi.Core.Settings; using Ombi.Helpers; using Ombi.Notifications.Models; using Ombi.Settings.Settings.Models; using Ombi.Settings.Settings.Models.Notifications; using Ombi.Store.Entities; using Ombi.Store.Repository; using Ombi.Store.Repository.Requests; namespace Ombi.Notifications.Agents { public class WebhookNotification : BaseNotification<WebhookSettings>, IWebhookNotification { public WebhookNotification(IWebhookApi api, ISettingsService<WebhookSettings> sn, ILogger<WebhookNotification> log, INotificationTemplatesRepository r, IMovieRequestRepository m, ITvRequestRepository t, ISettingsService<CustomizationSettings> s, IRepository<RequestSubscription> sub, IMusicRequestRepository music, IRepository<UserNotificationPreferences> userPref, UserManager<OmbiUser> um) : base(sn, r, m, t, s, log, sub, music, userPref, um) { Api = api; Logger = log; } public override string NotificationName => "WebhookNotification"; private IWebhookApi Api { get; } private ILogger<WebhookNotification> Logger { get; } protected override bool ValidateConfiguration(WebhookSettings settings) { return settings.Enabled && !string.IsNullOrEmpty(settings.WebhookUrl); } protected override async Task NewRequest(NotificationOptions model, WebhookSettings settings) { await Run(model, settings, NotificationType.NewRequest); } protected override async Task NewIssue(NotificationOptions model, WebhookSettings settings) { await Run(model, settings, NotificationType.Issue); } protected override async Task IssueComment(NotificationOptions model, WebhookSettings settings) { await Run(model, settings, NotificationType.IssueComment); } protected override async Task IssueResolved(NotificationOptions model, WebhookSettings settings) { await Run(model, settings, NotificationType.IssueResolved); } protected override async Task AddedToRequestQueue(NotificationOptions model, WebhookSettings settings) { await Run(model, settings, NotificationType.ItemAddedToFaultQueue); } protected override async Task RequestDeclined(NotificationOptions model, WebhookSettings settings) { await Run(model, settings, NotificationType.RequestDeclined); } protected override async Task RequestApproved(NotificationOptions model, WebhookSettings settings) { await Run(model, settings, NotificationType.RequestApproved); } protected override async Task AvailableRequest(NotificationOptions model, WebhookSettings settings) { await Run(model, settings, NotificationType.RequestAvailable); } protected override async Task Send(NotificationMessage model, WebhookSettings settings) { try { await Api.PushAsync(settings.WebhookUrl, settings.ApplicationToken, model.Data); } catch (Exception e) { Logger.LogError(LoggingEvents.WebhookNotification, e, "Failed to send webhook notification"); } } protected override async Task Test(NotificationOptions model, WebhookSettings settings) { var c = new NotificationMessageCurlys(); var testData = c.Curlys.ToDictionary(x => x.Key, x => x.Value); testData[nameof(NotificationType)] = NotificationType.Test.ToString(); var notification = new NotificationMessage { Data = testData, }; await Send(notification, settings); } private async Task Run(NotificationOptions model, WebhookSettings settings, NotificationType type) { var parsed = await LoadTemplate(NotificationAgent.Webhook, type, model); if (parsed.Disabled) { Logger.LogInformation($"Template {type} is disabled for {NotificationAgent.Webhook}"); return; } var notificationData = parsed.Data.ToDictionary(x => x.Key, x => x.Value); notificationData[nameof(NotificationType)] = type.ToString(); var notification = new NotificationMessage { Data = notificationData, }; await Send(notification, settings); } protected override async Task PartiallyAvailable(NotificationOptions model, WebhookSettings settings) { await Run(model, settings, NotificationType.PartiallyAvailable); } } } ```
```html <html> <head> <title>libvorbis - function - vorbis_comment_clear</title> <link rel=stylesheet href="style.css" type="text/css"> </head> <body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff"> <table border=0 width=100%> <tr> <td><p class=tiny>libvorbis documentation</p></td> <td align=right><p class=tiny>libvorbis version 1.3.2 - 20101101</p></td> </tr> </table> <h1>vorbis_comment_clear</h1> <p><i>declared in "vorbis/codec.h";</i></p> <p>This function frees the internal storage associated with a <a href="vorbis_comment.html">vorbis_comment</a> structure.</p> <p><i>Note:</i> Be careful if you have modified the vorbis_comment structure yourself, as libvorbis will try to use its own wrappers of memory allocation functions to free the contents of the vorbis_comment structure. This will not work correctly unless all arrays and comment strings contained in the vorbis_comment structure were allocated by libvorbis itself. This function is only guaranteed to be safe if all modification to the vorbis_comment structure was done using libvorbis functions.</p> <table border=0 color=black cellspacing=0 cellpadding=7> <tr bgcolor=#cccccc> <td> <pre><b> extern void vorbis_comment_clear(vorbis_comment *vc); </b></pre> </td> </tr> </table> <h3>Parameters</h3> <dl> <dt><i>vc</i></dt> <dd>The vorbis_comment structure to clear.</dd> </dl> <h3>Return Values</h3> <blockquote> <li>None.</li> </blockquote> <p> <br><br> <hr noshade> <table border=0 width=100%> <tr valign=top> <td><p class=tiny>copyright &copy; 2010 Xiph.Org</p></td> <td align=right><p class=tiny><a href="path_to_url">Ogg Vorbis</a></p></td> </tr><tr> <td><p class=tiny>libvorbis documentation</p></td> <td align=right><p class=tiny>libvorbis version 1.3.2 - 20101101</p></td> </tr> </table> </body> </html> ```
Willie O’Connor (born 14 March 1967) is an Irish retired hurler who played as a left corner-back for the Kilkenny senior team. O'Connor made his first appearance for the team during the 1988–89 National League and was a regular member of the starting fifteen until his retirement prior to the 2001 championship. During that time he has won three All-Ireland winners' medals, five Leinster winners' medals, one National League winners' medal and four All-Star awards. In 2000 O'Connor captained the team to the All-Ireland title. At club level O'Connor is a one-time All-Ireland medalist with Glenmore. In addition to this he has also won one Leinster winners' medal and five county championship winners' medals. O'Connor's brother, Eddie, is also an All-Ireland-winning captain with Kilkenny. Playing career Club O'Connor played his club hurling with Glenmore and enjoyed much success as the club became a new force in hurling throughout the 1980s and 1990s. In 1987 Glenmore reached the final of the county senior championship with Ballyhale Shamrocks providing the opposition. An exciting game developed over the hour, and a 4–10 to 3–9 victory gave O'Connor his first county winners' medal. After surrendering their title in 1988 and losing the championship decider to Ballyhale Shamrocks the following year, O'Connor's side reached the final again in 1990. Glenmore faced Clara on that occasion, however, O'Connor's side had a comfortable 3–15 to 2–6 victory. The club subsequently represented Kilkenny in the provincial series of games and even reached the final. Camross provided the opposition, however, O'Connor collected a Leinster club winners' medal following a 0–15 to 1–9 victory. An All-Ireland final showdown with Patrickswell of Limerick. The game was an exciting one, however, Patrickswell only held the lead on one occasion when Leonard Enright opened the scoring. A 1–13 to 0–12 score line gave Glenmore the title and gave O'Connor an All-Ireland club winners' medal. Glenmore lost their county, provincial and All-Ireland titles the following year, however, in 1992 O'Connor picked up a third county winners' medal following a 1–14 to 2–6 defeat of club kingpins Tullaroan. Once again Glenmore failed to retain their title the following year. It was 1995 before O'Connor's side reached the county championship decider once again. Fenians provided the opposition in a high-scoring hour of hurling. Glenmore were never really troubled as a 3–19 to 1–14 score line gave O'Connor a fourth county championship title. Many believed that this Glenmore team had reached the end of their life-cycle, however, in 1999 the club bounced back to reach the county final once again. Graigue-Ballycallan were the opponents and a close game developed. A 1–14 to 2–8 victory gave O'Connor a fifth and final county championship winners' medal. Inter-county O’Connor played with the Kilkenny minor and under-21 hurling teams throughout the 1980s, however, he enjoyed little success. He subsequently joined the county's senior team, making his debut against Waterford in a National Hurling League game in late 1988. O'Connor made his championship debut the following summer as Kilkenny reached the Leinster final. Offaly retained the provincial title for the second year in succession with a 3–15 to 4–9 victory. O'Connor remained on the fringes of the team for the next few years as Kilkenny prepared for a return to the big time. He missed Kilkenny's Leinster final triumph in 1991, however, he was named in the starting fifteen for the subsequent All-Ireland final meeting with Tipperary, the first such clash in twenty years. The opening thirty-five minutes saw both sides trade score-for-score, however, a controversial 20-metre free, miss-hit by Michael Cleary, landed in the net and gave Tipp a lead which they never surrendered. The final score of 1–16 to 0–15 resulted in a loss for Kilkenny. In 1992 Kilkenny bounced back from the All-Ireland defeat and O'Connor collected his first Leinster winners' medal following a comprehensive 3–16 to 2–9 defeat of Wexford. The subsequent All-Ireland final saw 'the Cats' take on Cork for the first time in nearly a decade. The game was well balanced for the first-half, however, D. J. Carey scored a goal four minutes before the break. This seemed to give Kilkenny the impetus to go on and win the game. Two more goals by John Power and Michael Phelan in the second-half secured a win for Kilkenny and a first All-Ireland winners' medal for O'Connor. He was later honoured with his first All-Star award In 1993 O'Connor's brother Eddie was captain as Kilkenny remained on top of the hurling world. A defeat of Wexford gave O'Connor his second Leinster winners' medal while he later lined out in his second successive All-Ireland final, this time against Galway. The game was a close affair with the westerners going a point ahead coming into the last quarter; however, Kilkenny won the match by five points, giving O'Connor a second All-Ireland winners' medal. Kilkenny failed in their bid to make in three-in-a-row the following year, however, in 1995 it looked as if Kilkenny's hurling fortunes were turning. At the start of the year O'Connor won his first National Hurling League title as Kilkenny defeated Clare. In spite of this victory 1995 proved to be an unhappy year as Kilkenny were trounced by Offaly in the Leinster final. The next few years proved to be frustrating ones for O'Connor and for Kilkenny. It was 1998 before O'Connor added a third Leinster winners' medal to his collection as Offaly were accounted for in the provincial final. Kilkenny later cruised to an All-Ireland final appearance where Offaly provided the opposition once again. The defeated Leinster finalists had certainly learned from their mistakes with Joe Errity and Brian Whelahan scoring key goals. At the full-time whistle Offaly emerged as the winners by 2–16 to 1–13. It was the first time that a defeated team had won the All-Ireland title via the 'back-door' system. In 1999 Brian Cody took over as manager, however, O'Connor remained a key member of the team. That year he won his fourth Leinster title as Offaly, the All-Ireland champions, fell heavily by 5–14 to 1–16 in the provincial final. The subsequent All-Ireland final saw Kilkenny take on Cork, their age-old rivals, for the first time since 1992. On that occasion O'Connor won his first All-Ireland medal, however, there was to be no success for him in 1999. A poor game on a wet day gave one of the youngest Cork teams ever the All-Ireland title on a score line of 0–13 to 0–12. In 2000 O'Connor was appointed captain of the Kilkenny team. He subsequently guided his team to another Leinster crown, his fifth in all. Offaly were accounted for once again, however, on this occasion the score line was a more respectable 2–21 to 1–13 in favour of 'the Cats'. An appearance in his sixth All-Ireland soon followed for O'Connor as 'the Cats' lined out against Offaly for the second time that season. After just six minutes D. J. Carey scored the first of five goals as Kilkenny exposed the Offaly full-back line. Carey scored 2–4 that day and shared his second goal with a young Henry Shefflin. Further goals by Charlie Carter and Eddie Brennan saw Kilkenny win on a score line of 5–15 to 1–14 and allowed O'Connor capture his third All-Ireland medal. He also had the honour of lifting the Liam MacCarthy Cup on behalf of the team. He later collected his second All-Star award. In captaining Kilkenny to the All-Ireland title O'Connor became the second member of his family to do so. His brother Eddie was captain when Kilkenny won in 1993. It was the second time that two brothers had guided their county to championship honours as Liam and Ger Fennelly had both earlier guided Kilkenny to All-Ireland titles. In 2001 O'Connor was almost thirty-four years-old, an age when most inter-county players would contemplate retirement. He played no part in Kilkenny's National League campaign, however, he intended returning in time for the championship. When Brian Cody announced his twenty nine-man panel prior to the opening of the summer campaign, O'Connor was not included. This effectively brought his inter-county career to an end. Inter-provincial O'Connor also had the honour of being called for duty on the Leinster team in the inter-provincial series of games. He first tasted success with his province in 1993 when he lined out in the inter-provincial final. A 1–15 to 2–6 defeat of Ulster gave O'Connor his first Railway Cup winners' medal. After a few years being sidelined O'Connor was back on the team again in 1998, this time as captain. Once again Leinster reached the final where Connacht provided the opposition. The eastern province beat the western province by the narrowest of margins on a score line of 0–16 to 2–9. It was O'Connor's second Railway Cup winners' medal while he also had the honour of lifting the cup. O'Connor was included on the team again in 2000, however, Leinster were beaten by Munster in the final on that occasion. Throughout his inter-provincial career, O'Connor's commitment to the Leinster team and his ability to perform at the highest level further solidified his reputation as a notable figure in Irish hurling. His experiences in the Railway Cup series were not only about victories and defeats but also about the camaraderie, sportsmanship, and pride associated with representing one's province in this prestigious competition. Quotes "For the last six years this cup has wandered around and didn't know where twas going. Now it knows it's going home." – O'Connor's speech after accepting the Liam MacCarthy Cup in 2000. It was Kilkenny's first All-Ireland title since 1993 and brought an end to the so-called hurling revolution. References 1967 births Living people Glenmore hurlers Kilkenny inter-county hurlers Leinster inter-provincial hurlers All-Ireland Senior Hurling Championship winners
Yuzhny () is an urban-type settlement in Barnaul urban okrug, Altai Krai, Russia. The population was 19,799 as of 2016. Geography Yuzhny is located 15 km south of Barnaul (the district's administrative centre) by road. Ponomarevka is the nearest rural locality. References Urban-type settlements in Altai Krai
```scala /* */ package akka.stream.alpakka.googlecloud.bigquery.storage.impl import akka.NotUsed import akka.stream.scaladsl.Source import com.google.cloud.bigquery.storage.v1.storage.{BigQueryReadClient, ReadRowsRequest, ReadRowsResponse} import com.google.cloud.bigquery.storage.v1.stream.ReadSession object SDKClientSource { private val RequestParamsHeader = "x-goog-request-params" def read(client: BigQueryReadClient, readSession: ReadSession): Seq[Source[ReadRowsResponse.Rows, NotUsed]] = { readSession.streams .map(stream => { client .readRows() .addHeader(RequestParamsHeader, s"read_stream=${stream.name}") .invoke(ReadRowsRequest(stream.name)) .map(_.rows) }) } } ```
Ullam Ketkumae... () is a 2005 Tamil-language romantic drama film directed and co-written by Jeeva, with dialogues by Sujatha. The film stars Shaam, Arya, Laila, Asin and Pooja as five college students. The film's score and soundtrack are composed by Harris Jayaraj, while Vairamuthu penned the lyrics for the songs. The film tells the reunion of five friends who were together at college and exploring their relationships during the years. The film released after several delays in 2005 and went on to win critical and commercial success. The film marked the first successful film for Jeeva and Shaam while Arya and Asin received several film offers after the release of the film. Plot The film is all about a group of five college friends — Shyam, Emaan, Pooja, Priya and Irene. The friends gather for Emaan's wedding, years after everyone has parted ways. The film starts with Pooja leaving the United States to go to Indian cricketer and her friend Emaan's wedding. Meanwhile, back in India, everyone else is helping Emaan with the preparations for his wedding and catching up with their long-lost college friends. The movie goes through series of flashbacks of old memories during their college days. Emaan and Irene meet for the first time after years. It turns out that they were once in love during their college days but Irene, who is from an unstable family, decides to part ways with Emaan after he loses focus on his long time goal of becoming a successful cricketer. Another flashback occurs when Shyam gets reminded of Pooja. She is a fun-loving tomboyish and naive girl, who is best friends with Shyam. Shyam realizes that he is in love with Priya, but on the other hand, Pooja realizes that she is falling for Shyam. Shyam and Pooja had respectively decided to propose their love interests on the coming Valentine's Day. But on that day, Pooja learns beforehand that Shyam is in love with Priya instead. Heartbroken by what she has just learned, she decides to keep her love for him a secret. When Shyam proposes Priya, she rejects his love as she believes in a more traditional approach towards finding a life partner. She reveals to him that she will be getting married, right after their graduation, to the man of her parents' choice. Pooja eventually goes to the US for her higher studies and settles down there. Shyam has also tried to move on since then and becomes a fashion designer. The film transitions back to the present on Emaan's wedding day. Everyone attends his wedding as Pooja finally arrives. She is no longer the same girl she was back then, as she is much more mature now and not as tomboyish as she was back then. Over sometime, Shyam has come to realize that he missed Pooja's presence and is much fond of her now. He realizes that he had failed to appreciate her all those times when she was there with him. The day after Emaan's wedding, Pooja leaves to catch her flight back to USA. Right before her departure, she decides to pass Shyam the Valentine's Day card that she had wanted to hand him during their college days and reveals her love for him. Shyam realizes that Pooja is the one that was meant to be for him and not Priya. The movie ends with Shyam accepting Pooja's love for him. Cast Shaam as Shyam Arya as Emaan Laila as Pooja Asin as Priya Pooja as Irene Murali as Pooja's father Srinath as Pathchu Pyramid Natarajan as Priya's father K.P.A.C. Lalitha as Emaan's mother Revathi Sankaran as Priya's mother Japan Kumar as a college student Kaveri Lalchand as Irene's mother Rajiv Choudary (uncredited) as Irene's father Krishnamachari Srikkanth (uncredited) as himself Hemanth Kumar (uncredited) as a college student Raju Sundaram as a singer in the song "Mazhai Mazhai" Production In April 2002, where it was reported that Shaam and Richa Pallod were going to team up with director Jeeva, who had launched Shaam in 12B (2001), for a college love story titled Pepsi. Susi Ganeshan had appealed for the title Pepsi for a film; however, since the title Pepsi was registered by Jeeva, Ganeshan ended up renaming his film Five Star (2002). The title Pepsi had stemmed from the first letter from the names of the five friends — Priya, Emaan, Pooja, Shyam and Irene. The film was later renamed and the film took part of the brand Pepsi's tagline in Tamil Nadu – Ullam Ketkumae More – as the new title. Laila was reported to be a part of the cast. Asin signed the film aged eighteen and the film was meant to mark her début in Tamil films. This was the second film that Asin worked on after the Malayalam film Narendran Makan Jayakanthan Vaka (2001). While working as a software engineer, Jamshad was approached by Jeeva to audition for the film in 2003 after Jeeva spotted him walking in his neighbourhood. Jeeva gave Jamshad the stage name of Arya for this film. Pooja was also signed on to make her début. Srinath, who worked as an assistant director under Jeeva in 12B, was cast in this film as Shaam and Arya's friend. Rajesh dubbed for Malayalam actor Murali in the film. Model Hemanth Kumar was cast as a college student. Art director Thota Tharani created a college campus for the film to be shot in, with his work drawing appreciation. A scene featuring an inter college day cultural had 100 students from various states take part in the shooting while decorations and a podium were put up for a marriage scene in Taj Connemara hotel. Raju Sundaram choreographed five songs including a song shot at hot water springs in New Zealand. The film went through production hell, with three years being spent on the announcement till release. The film was supposed to be the debut film of Arya, Asin, and Pooja. Th delay of the film enabled the lead actors to gain popularity with other releases: Arinthum Ariyamalum (2005) for Arya, M. Kumaran Son of Mahalakshmi (2004) for Asin, and Jay Jay (2003) and Attahasam (2004) for Pooja. Despite giving indications that the film would release after delays on 14 April 2004 it was further pushed back due to financial issues. In May 2005, the Supreme Court finally cleared the decks for the release, as earlier the Madras High court by a 25 February order appointed "Joint Receivers" for the film, which was objected by Prasad Labs who had gone to Supreme Court. It was agreed that the collections from the film will be received by "joint receivers" who will pay Prasad Labs for 72 prints of the film. Music The music and background score were composed by Harris Jayaraj and became popular upon release. The songs were released on YouTube by Think Music India in 2020. Release and reception Ullam Ketkumae was released on 3 June 2005 and became a commercial success at the box office with pundits describing the film as a "super hit". A critic from Sify gave the film a verdict of above average and stated that "On the whole, Jeeva has been successful to make an entertainer with a very good story. Everything, from the choice of lead actors, their lines and gestures, interpersed with perfect song-n-dance is perfectly coordinated". Malini Mannath of Chennai Online opined that Laila's performance was the "surprise packet" and that "Jeeva's camera provides some colourful visuals and together with Harris Jairaj's peppy numbers adds to the film's entertainment value. Ullam Kelkumae is an urban Autograph, worth a watch". Visual Dasan of Kalki praised Jeeva's realistic characters, the acting of the cast, and Harris Jayaraj's music. He said the film can be rewatched for the feelings it induces. The film took a 90 percent opening in four Chennai screens with large collections reported at the Devi theatre in Chennai in the opening weekend. The film opened at number two at the Chennai box office despite stiff competition, just below the Rajinikanth starrer Chandramukhi. The film was also dubbed in Telugu as Preminchi Choodu and released on 30 March 2006. This was the first commercially successful film for both Jeeva and Shaam. They both had previously collaborated for 12B, which did not fare as well. Legacy Ullam Ketkumae was notably one of the first Tamil films in the reunion genre. Several news websites including The Times of India and The New Indian Express listed this film as one to watch on Friendship Day along with several other films including Thalapathi (1991), Kadhal Desam (1996), Friends (2001), Chennai 600028 (2007), Naadodigal (2009), and Nanban (2012). The success of the film brought a series of offers for Shaam, whose career was struggling prior to release. The success of the film prompted ABCD, another film starring Shaam, to release two months later. Arya and Asin were able to consolidate their positions as rising actors. References External links 2000s buddy films 2000s Tamil-language films 2005 films 2005 romantic drama films Films directed by Jeeva Films scored by Harris Jayaraj Films set in universities and colleges Indian buddy drama films Indian romantic drama films
```xml <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "../../../tools/boostbook/dtd/boostbook.dtd"> (See accompanying file LICENSE_1_0.txt or path_to_url --> <section id="date_time.local_time.local_time_period"> <title>Local Time Period</title> <link linkend="local_time_period_intro">Introduction</link> -- <link linkend="local_time_period_header">Header</link> -- <link linkend="local_time_period_constr">Construction</link> -- <link linkend="local_time_period_accessors">Accessors</link> -- <link linkend="local_time_period_operators">Operators</link> <anchor id="local_time_period_intro" /> <bridgehead renderas="sect3">Introduction</bridgehead> <para> The class <code>boost::local_time::local_time_period</code> provides direct representation for ranges between two local times. Periods provide the ability to simplify some types of calculations by simplifying the conditional logic of the program. </para> <para> A period that is created with beginning and end points being equal, or with a duration of zero, is known as a zero length period. Zero length periods are considered invalid (it is perfectly legal to construct an invalid period). For these periods, the <code>last</code> point will always be one unit less that the <code>begin</code> point. </para> <anchor id="local_time_period_header" /> <bridgehead renderas="sect3">Header</bridgehead> <para> <programlisting>#include "boost/date_time/local_time/local_time.hpp" //include all types plus i/o or #include "boost/date_time/local_time/local_time_types.hpp" //no i/o just types</programlisting> </para> <anchor id="local_time_period_constr" /> <bridgehead renderas="sect3">Construction</bridgehead> <para> <informaltable frame="all"> <tgroup cols="2"> <thead> <row> <entry valign="top" morerows="1">Syntax</entry> <entry>Description</entry> </row> <row> <entry>Example</entry> </row> </thead> <tbody> <row> <entry valign="top" morerows="1"><screen>local_time_period(...) Parameters: local_date_time beginning local_date_time end</screen></entry> <entry> Create a period as [begin, end). If end is &lt;= begin then the period will be defined as invalid.</entry> </row> <row> <entry><screen>time_zone_ptr zone(new posix_time_zone("MST-07")); local_date_time beg(ptime(date(2005,Jan,1),hours(0)), zone); local_date_time end(ptime(date(2005,Feb,1),hours(0)), zone); // period for the entire month of Jan 2005 local_time_period ltp(beg, end);</screen> </entry> </row> <row> <entry valign="top" morerows="1"><screen>local_time_period(...) Parameters: local_date_time beginning time_duration length</screen></entry> <entry>Create a period as [begin, begin+len) where end would be begin+len. If len is &lt;= zero then the period will be defined as invalid.</entry> </row> <row> <entry><screen>time_zone_ptr zone(new posix_time_zone("MST-07")); local_date_time beg(ptime(date(2005,Jan,1),hours(0)), zone); // period for the whole day of 2005-Jan-01 local_time_period ltp(beg, hours(24));</screen> </entry> </row> <row> <entry valign="top" morerows="1"><screen>local_time_period(local_time_period rhs)</screen></entry> <entry>Copy constructor</entry> </row> <row> <entry><screen>local_time_period ltp1(ltp);</screen></entry> </row> </tbody> </tgroup> </informaltable> </para> <anchor id="local_time_period_accessors" /> <bridgehead renderas="sect3">Accessors</bridgehead> <para> <informaltable frame="all"> <tgroup cols="2"> <thead> <row> <entry valign="top" morerows="1">Syntax</entry> <entry>Description</entry> </row> <row> <entry>Example</entry> </row> </thead> <tbody> <row> <entry valign="top" morerows="1"><screen>local_date_time begin()</screen></entry> <entry>Return first local_date_time of the period.</entry> </row> <row> <entry><screen>time_zone_ptr zone(new posix_time_zone("MST-07")); local_date_time ldt((ptime(date(2005,Jan,1)),hours(0)), zone); local_time_period ltp(ldt, hours(2)); ltp.begin(); // => 2005-Jan-01 00:00:00</screen> </entry> </row> <row> <entry valign="top" morerows="1"><screen>local_date_time last()</screen></entry> <entry>Return last local_date_time in the period</entry> </row> <row> <entry><screen>time_zone_ptr zone(new posix_time_zone("MST-07")); local_date_time ldt((ptime(date(2005,Jan,1),hours(0))), zone); local_time_period ltp(ldt, hours(2)); ltp.last(); // => 2005-Jan-01 01:59:59.999999999</screen> </entry> </row> <row> <entry valign="top" morerows="1"><screen>local_date_time end()</screen></entry> <entry>Return one past the last in period</entry> </row> <row> <entry><screen>time_zone_ptr zone(new posix_time_zone("MST-07")); local_date_time ldt((ptime(date(2005,Jan,1),hours(0))), zone); local_time_period ltp(ldt, hours(2)); ltp.end(); // => 2005-Jan-01 02:00:00</screen> </entry> </row> <row> <entry valign="top" morerows="1"><screen>time_duration length()</screen></entry> <entry>Return the length of the local_time period.</entry> </row> <row> <entry><screen>time_zone_ptr zone(new posix_time_zone("MST-07")); local_date_time ldt((ptime(date(2005,Jan,1),hours(0))), zone); local_time_period ltp(ldt, hours(2)); ltp.length(); // => 02:00:00</screen> </entry> </row> <row> <entry valign="top" morerows="1"><screen>bool is_null()</screen></entry> <entry>True if period is not well formed. eg: end less than or equal to begin.</entry> </row> <row> <entry><screen>time_zone_ptr zone(new posix_time_zone("MST-07")); local_date_time beg((ptime(date(2005,Feb,1),hours(0))), zone); local_date_time end((ptime(date(2005,Jan,1),hours(0))), zone); local_time_period ltp(beg, end); ltp.is_null(); // => true</screen> </entry> </row> <row> <entry valign="top" morerows="1"><screen>bool contains(local_date_time)</screen></entry> <entry>True if local_date_time is within the period. Zero length periods cannot contain any points</entry> </row> <row> <entry><screen>time_zone_ptr zone(new posix_time_zone("MST-07")); local_date_time beg((ptime(date(2005,Jan,1),hours(0))), zone); local_date_time end((ptime(date(2005,Feb,1),hours(0))), zone); local_time_period jan_mst(beg, end); local_date_time ldt((ptime(date(2005,Jan,15),hours(12))), zone); jan_mst.contains(ldt); // => true local_time_period zero(beg, beg); zero.contains(beg); // false</screen></entry> </row> <row> <entry valign="top" morerows="1"><screen>bool contains(local_time_period)</screen></entry> <entry>True if period is within the period</entry> </row> <row> <entry><screen>// using jan_mst period from previous example local_date_time beg((ptime(date(2005,Jan,7),hours(0))), zone); local_time_period ltp(beg, hours(24)); jan_mst.contains(ltp); // => true</screen></entry> </row> <row> <entry valign="top" morerows="1"><screen>bool intersects(local_time_period)</screen></entry> <entry> True if periods overlap</entry> </row> <row> <entry><screen>// using jan_mst period from previous example local_date_time beg((ptime(date(2005,Jan,7),hours(0))), zone); local_date_time end((ptime(date(2005,Feb,7),hours(0))), zone); local_time_period ltp(beg, end); jan_mst.intersects(ltp); // => true</screen></entry> </row> <row> <entry valign="top" morerows="1"><screen>local_time_period intersection(local_time_period)</screen></entry> <entry>Calculate the intersection of 2 periods. Null if no intersection.</entry> </row> <row> <entry><screen>// using jan_mst period from previous example local_date_time beg((ptime(date(2005,Jan,7),hours(0))), zone); local_date_time end((ptime(date(2005,Feb,7),hours(0))), zone); local_time_period ltp(beg, end); local_time_period res(jan_mst.intersection(ltp)); // res => 2005-Jan-07 00:00:00 through // 2005-Jan-31 23:59:59.999999999 (inclusive)</screen></entry> </row> <row> <entry valign="top" morerows="1"><screen>local_time_period merge(local_time_period)</screen></entry> <entry>Returns union of two periods. Null if no intersection.</entry> </row> <row> <entry><screen>// using jan_mst period from previous example local_date_time beg((ptime(date(2005,Jan,7),hours(0))), zone); local_date_time end((ptime(date(2005,Feb,7),hours(0))), zone); local_time_period ltp(beg, end); local_time_period res(jan_mst.merge(ltp)); // res => 2005-Jan-07 00:00:00 through // 2005-Feb-06 23:59:59.999999999 (inclusive)</screen></entry> </row> <row> <entry valign="top" morerows="1"><screen>local_time_period span(local_time_period)</screen></entry> <entry>Combines two periods and any gap between them such that begin = min(p1.begin, p2.begin) and end = max(p1.end , p2.end).</entry> </row> <row> <entry><screen>// using jan_mst period from previous example local_date_time beg((ptime(date(2005,Mar,1),hours(0))), zone); local_date_time end((ptime(date(2005,Apr,1),hours(0))), zone); local_time_period mar_mst(beg, end); local_time_period res(jan_mst.span(mar_mst)); // res => 2005-Jan-01 00:00:00 through // 2005-Mar-31 23:59:59.999999999 (inclusive)</screen></entry> </row> <row> <entry valign="top" morerows="1"><screen>void shift(time_duration)</screen></entry> <entry>Add duration to both begin and end.</entry> </row> <row> <entry><screen>local_date_time beg((ptime(date(2005,Mar,1),hours(0))), zone); local_date_time end((ptime(date(2005,Apr,1),hours(0))), zone); local_time_period mar_mst(beg, end); mar_mst.shift(hours(48)); // mar_mst => 2005-Mar-03 00:00:00 through // 2005-Apr-02 23:59:59.999999999 (inclusive)</screen></entry> </row> </tbody> </tgroup> </informaltable> </para> <anchor id="local_time_period_operators" /> <bridgehead renderas="sect3">Operators</bridgehead> <para> <informaltable frame="all"> <tgroup cols="2"> <thead> <row> <entry valign="top" morerows="1">Syntax</entry> <entry>Description</entry> </row> <row> <entry>Example</entry> </row> </thead> <tbody> <!-- TODO: the streaming operators have not bee changed from time_period to local_time_period <row> <entry valign="top" morerows="1"><screen>operator&lt;&lt;</screen></entry> <entry>Output streaming operator for time duration. Uses facet to output [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are left out when zero.</entry> </row> <row> <entry><screen>[2002-Jan-01 01:25:10.000000001/ \ 2002-Jan-31 01:25:10.123456789]</screen></entry> </row> <row> <entry valign="top" morerows="1"><screen>operator&gt;&gt;</screen></entry> <entry>Input streaming operator for time duration. Uses facet to read [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are left out when zero.</entry> </row> <row> <entry><screen>[2002-Jan-01 01:25:10.000000001/ \ 2002-Jan-31 01:25:10.123456789]</screen></entry> </row> --> <row> <entry valign="top" morerows="1"><screen>operator==, operator!=</screen></entry> <entry>Equality operators. Periods are equal if ltp1.begin == ltp2.begin &amp;&amp; ltp1.last == ltp2.last</entry> </row> <row> <entry><screen>if (ltp1 == ltp2) {...</screen></entry> </row> <row> <entry valign="top" morerows="1"><screen>operator&lt;</screen></entry> <entry>Ordering with no overlap. True if ltp1.end() less than ltp2.begin()</entry> </row> <row> <entry><screen>if (ltp1 &lt; ltp2) {...</screen></entry> </row> <row> <entry valign="top" morerows="1"><screen>operator&gt;</screen></entry> <entry>Ordering with no overlap. True if ltp1.begin() greater than ltp2.end()</entry> </row> <row> <entry><screen>if (ltp1 > ltp2) {... etc</screen></entry> </row> <row> <entry valign="top" morerows="1"><screen>operator&lt;=, operator&gt;=</screen></entry> <entry>Defined in terms of the other operators.</entry> </row> <row> <entry></entry> </row> </tbody> </tgroup> </informaltable> </para> </section> ```
```java package com.journaldev.spring.jdbc.main; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.journaldev.spring.jdbc.model.Address; import com.journaldev.spring.jdbc.model.Customer; import com.journaldev.spring.jdbc.service.CustomerManager; import com.journaldev.spring.jdbc.service.CustomerManagerImpl; public class TransactionManagerMain { public static void main(String[] args) { ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext( "spring.xml"); CustomerManager customerManager = ctx.getBean("customerManager", CustomerManagerImpl.class); Customer cust = createDummyCustomer(); customerManager.createCustomer(cust); ctx.close(); } private static Customer createDummyCustomer() { Customer customer = new Customer(); customer.setId(2); customer.setName("Pankaj"); Address address = new Address(); address.setId(2); address.setCountry("India"); // setting value more than 20 chars, so that SQLException occurs address.setAddress("Albany Dr, San Jose, CA 95129"); customer.setAddress(address); return customer; } } ```
Ue... paisano! is a 1953 Argentine film directed by Manuel Romero starring Susana Campos, Nicola Paone, Fidel Pintos and Vicente Rubino. Nicola Panoe sang a song with the same title. References External links 1953 films 1950s Spanish-language films Argentine black-and-white films 1950s Argentine films
"Moanin' at Midnight" is a blues song written and recorded by Howlin' Wolf in 1951. The recording was released on Chess Records as his debut single. It charted on Billboard's R&B chart, but the B-side, "How Many More Years," became the popular side of the record. Recording and release Chester Burnett began performing as blues musician Howlin' Wolf in 1948. He formed a band in West Memphis, Arkansas and performed locally. There he was discovered by Clarksdale native Ike Turner. After Turner and his band the Kings of Rhythm recorded "Rocket 88" for Sam Phillips in 1951, he brought Howlin' Wolf to record for Phillips in Memphis, Tennessee. Howlin' Wolf recorded a session for Phillips at his Memphis Recording Service in July 1951. The band consisted of Howlin' Wolf singing and playing harmonica with Ike Turner on piano, Willie Johnson on guitar, and Willie Steele on drums. Phillips described "Moanin' at Midnight" as "the most different record I ever heard." Phillips had not yet founded Sun Records, so he leased his recordings to Chess Records. Chess released "Moanin' at Midnight" in August 1951, with "How Many More Years" as the B-side. "Moanin' at Midnight" reached No. 10 on the Billboard Most Played Juke Box R&B Records chart on November 10, 1951. "How Many More Years" grew in popularity and peaked at No. 4 on the Most Played Juke Box R&B Records chart in March 1952. Turner, who was also a talent scout for the Bihari brothers at Modern Records, took Howlin' Wolf to record another version of "Moanin' at Midnight" at radio station KWEM in West Memphis. It was released on the subsidiary RPM Records as "Morning at Midnight" in September 1951, the B-side to "Riding In The Moonlight." This caused a conflict between the Chess brothers and the Bihari brothers. Howlin' Wolf recorded a few more singles for RPM, but by 1952, he was recording exclusively for Chess. Howlin' Wolf is the credited songwriter on the RPM release, but the Chess single was originally credited to Carl Germany, who was a disc jockey and dance promoter in Chicago. Later reissues of the recordings have been revised to credit to Chester Burnett. "Moanin' at Midnight" and "How Many More Years" later appeared on Howlin' Wolf's debut album Moanin' in the Moonlight (1959). "Morning at Midnight" and "Riding in the Moonlight" appeared on the compilation Howling Wolf Sings the Blues (1962). References 1951 songs 1951 debut singles Howlin' Wolf songs Chess Records singles
Leonīds Beresņevs (, Leonid Arkadyevich Beresnev; born 6 July 1958) is a Latvian/Soviet former ice hockey player and coach. Born in Kirov Oblast he is a coach of the Latvian U-20 junior team. His first term of coaching the Latvian national team was from 1996 till 1999. In the 1996 world championships, when Latvia was playing in division B, they won and for the first time were promoted to division A where they finished at 7th place in 1997. From that time they have remained in division A. Beresņevs' second term started in 2004 and ended in 2006. In 2005 Latvia qualified for Torino Olympics where they took the last place. Beresņevs has been a coach for almost all the best Latvian ice hockey clubs since 1995. In 1996/1997 his coached Juniors Riga took gold at EEHL. In 2003/2004 Beresņevs was head coach in Russian Hockey Super League team Amur Khabarovsk. In 2007-08 he trained Estonian ice hockey club Tartu Big Diamonds and in 2008-09 he became the coach of Latvian club ASK/Ogre. Career statistics (as a player) References External links 1958 births Living people Soviet emigrants to Latvia People from Kirovo-Chepetsk Latvian ice hockey defencemen Latvia men's national ice hockey team coaches Latvian sports coaches Latvian ice hockey coaches Dinamo Riga players Soviet ice hockey defencemen
Nancy Keesing (7 September 1923 – 19 January 1993) was an Australian poet, writer, editor and promoter of Australian literature. Early life Nancy Keesing was born in Sydney, Australia and attended school at Sydney Church of England Girls' Grammar School (SCEGGS) and the Frensham School (Mittagong). During WW2 she worked as a naval account clerk on Garden Island in Sydney Harbour. After the war she enrolled in social sciences at the University of Sydney, and then worked as a social worker at the Royal Alexandra Hospital for Children, Camperdown (1947–1951). Literary career From about 1952 she worked full-time as a writer and researcher with The Bulletin magazine. She mainly worked with Douglas Stewart, particularly to research and collect historical Australian songs and bush ballads. She was active in a number of literary associations, most notably the Australian Society of Authors. She edited the ASA journal The Australian Author from 1971 to 1974. She was chair of the Literature Board, Australia Council, 1974–1977. She was also active in the English Association and the Australian Jewish Historical Society. She became a council member of the Kuring-gai College of Advanced Education. Her literary career covered several fields, including poetry, literary criticism, editing, children's novels and biography. One of her most well known works is Shalom, a collection of Australian Jewish stories. She wrote or edited 26 volumes. She wrote two memoirs: Garden Island People, about her work on Garden Island, and Riding the Elephant, mainly about her literary career. Personal life She married Dr Mark Hertzberg, a chemical engineer with CSR, and they had two children. They lived next to Kylie Tennant and her family for 20 years in Hunters Hill. Awards and legacy Keesing was made a Member of the Order of Australia (AM) in the 1979 Australian Day Honours for service to literature. The annual Nancy Keesing Fellowship was founded by her husband in her honour. It is for research on aspects of Australian life and culture using the resources and archives of the State Library of New South Wales. Bibliography Poetry Fiction Non-fiction References External links 2 poems Nancy Keesing Fellowship Children Poem 1923 births 1993 deaths Australian memoirists Jewish Australian writers Australian women memoirists Australian women poets 20th-century Australian women writers 20th-century Australian poets Jewish women writers Members of the Order of Australia University of Sydney alumni People educated at Frensham School 20th-century memoirists
```kotlin /* */ package splitties.preferences import android.content.Context import android.os.Build.VERSION.SDK_INT import splitties.init.appCtx import splitties.init.directBootCtx internal actual fun getPreferencesStorage( name: String?, androidAvailableAtDirectBoot: Boolean ): PreferencesStorage = getSharedPreferences(name, androidAvailableAtDirectBoot) internal fun getSharedPreferences( name: String?, androidAvailableAtDirectBoot: Boolean ): PreferencesStorage { val actualName = name ?: "${appCtx.packageName}_preferences" val storageCtx: Context = if (androidAvailableAtDirectBoot && SDK_INT > 24) { // Moving the sharedPreferences from is done by the system only if you had it outside // the direct boot available storage or if the device was running Android M or older, // and just got updated. directBootCtx.moveSharedPreferencesFrom(appCtx, actualName) directBootCtx } else appCtx return storageCtx.getSharedPreferences(actualName, Context.MODE_PRIVATE) } actual typealias PreferencesStorage = android.content.SharedPreferences actual typealias OnPreferenceChangeListener = android.content.SharedPreferences.OnSharedPreferenceChangeListener actual typealias PreferencesEditor = android.content.SharedPreferences.Editor ```
Vlade Lazarevski (; born 9 June 1983) is a former professional footballer who played as a defender. He represented the Macedonia national football team internationally. Club career On 19 December 2007, Lazarevski was thought to be in England on a trial-basis training with Premier League team Derby County; it was unsuccessful and he returned to Poland. In late February, Lazarevski emerged in Ukraine, training with a team of Ukrainian Premier League FC Metalist Kharkiv. Soon after transfer occurred and Vlade was announced to the public as club's newest signing. He played for Karpaty Lviv in 2009 before joining Rijeka on 27 January 2010. Lazarevski signed with Lokomotiv Astana on 8 July 2010. In December 2010 Lazarevski confirmed his move to FC Tobol. The club was not paying his salary so he reported them to FIFA and he became a free agent. The next summer, on his 28th Birthday he signed with Amiens who had just been promoted to the French Ligue 2. In February 2014 he signed with NK Zvijezda Gradačac. In the season 2016–17 he helped FK Temnić Lipa win the Serbian League East and achieve promotion to Serbian second level, the Serbian First League. International career While playing in Serbia with Napredak, still as a talented youngster, he became almost simultaneously a member of the Macedonia U-21 team. He made his debut for the Macedonian senior team in a June 2005 FIFA World Cup qualification match against the Czech Republic and has earned a total of 43 caps, scoring no goals. His final international was an October 2011 European Championship qualification match against Slovakia. References External links Profile at MacedonianFootball 1983 births Living people Footballers from Kruševac Men's association football central defenders Macedonian men's footballers North Macedonia men's under-21 international footballers North Macedonia men's international footballers FK Kumanovo players FK Napredak Kruševac players Dyskobolia Grodzisk Wielkopolski players FC Metalist Kharkiv players Polonia Warsaw players FC Karpaty Lviv players HNK Rijeka players FC Astana players Amiens SC players FK Smederevo 1924 players Flamurtari FC players NK Zvijezda Gradačac players FK Radnički Niš players FK Temnić players First League of Serbia and Montenegro players Ekstraklasa players Ukrainian Premier League players Croatian Football League players Kazakhstan Premier League players Ligue 2 players Serbian SuperLiga players Kategoria Superiore players Premier League of Bosnia and Herzegovina players Serbian First League players Macedonian expatriate men's footballers Expatriate men's footballers in Poland Macedonian expatriate sportspeople in Poland Expatriate men's footballers in Ukraine Macedonian expatriate sportspeople in Ukraine Expatriate men's footballers in Croatia Macedonian expatriate sportspeople in Croatia Expatriate men's footballers in Kazakhstan Macedonian expatriate sportspeople in Kazakhstan Expatriate men's footballers in France Macedonian expatriate sportspeople in France Expatriate men's footballers in Albania Macedonian expatriate sportspeople in Albania Expatriate men's footballers in Bosnia and Herzegovina Macedonian expatriate sportspeople in Bosnia and Herzegovina
It's Always You is a song recorded and composed by Chinese singer-songwriter Xu Weizhou. It is the third single released from Xu's album "The Time". It is included in the second quarter of the album. Background and release It's Always You is composed and produced by Lee McCutcheon with the assistance of Jeremy Thurber in lyrical writing. It has a length of three minutes and eighteen seconds. It is the third single released from Xu's album "The Time" and is included in its 2nd quarter. It is Xu's first attempt at singing EDM and his second pure English song next to "I Remember Your Eyes". The whole quarter was officially released on 20 October 2017; same day of his 23rd birthday for free online. The official music video was directed by Chen Man and was released on 31 October at several Chinese streaming sites. Upon its release, netizens praised the improvement of Xu's English pronunciation. The music video has topped the Billboard China V Chart consecutively for 2 weeks. Xu performed the song live for the first time during his "Light 2017" concert on 9 December. Credits and personnel Credits were adapted from the official music video. Star Power (Beijing) Culture Media Co., Ltd and Timmy Xu Studio – presentation, production Lee McCutcheon – producer, composer, lyricist, music arrangement, backing vocals, backing vocals arrangement Jeremy Thurber – lyricist, backing vocals, backing vocals arrangement Xu Weizhou – lead vocals Chen Man – director, music video producer Gabrielle – executive director / D.O.P. Li Hao – executive producer Mia Shen, Haruki Gao, Kary Tsui – video production crews Paul Gatehouse – mixing engineer Wildtone London – mixing studio Chart performance Weekly References 2017 songs 2017 singles
```java /* * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ package io.flutter.editor; import com.intellij.openapi.project.Project; import io.flutter.dart.FlutterDartAnalysisServer; import io.flutter.inspector.InspectorGroupManagerService; /** * Context with references to data useful for widget editing code. */ public class WidgetEditingContext { public final Project project; public final FlutterDartAnalysisServer flutterDartAnalysisService; public final InspectorGroupManagerService inspectorGroupManagerService; public final EditorPositionService editorPositionService; public WidgetEditingContext( Project project, FlutterDartAnalysisServer flutterDartAnalysisService, InspectorGroupManagerService inspectorGroupManagerService, EditorPositionService editorPositionService ) { this.project = project; this.flutterDartAnalysisService = flutterDartAnalysisService; this.inspectorGroupManagerService = inspectorGroupManagerService; this.editorPositionService = editorPositionService; } } ```
The 1977 Dartmouth Big Green football team was an American football team that represented Dartmouth College during the 1977 NCAA Division I football season. Dartmouth tied for third place in the Ivy League. In their seventh and final season under head coach Jake Crouthamel, the Big Green compiled a 6–3 record and outscored opponents 141 to 92. Curtis Oberg and James Vailas were the team captains. The Big Green's 4–3 conference record earned a three-way tie for third in the Ivy League. Dartmouth outscored Ivy opponents 86 to 82. Dartmouth played its home games at Memorial Field on the college campus in Hanover, New Hampshire. Schedule References Dartmouth Dartmouth Big Green football seasons Dartmouth Big Green football
```javascript /** * @license Apache-2.0 * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ 'use strict'; // MODULES // var tape = require( 'tape' ); var isUint32Array = require( '@stdlib/assert/is-uint32array' ); var random = require( './../lib' ); // TESTS // tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); t.strictEqual( typeof random, 'function', 'main export is a function' ); t.end(); }); tape( 'attached to the main export is a `factory` method', function test( t ) { t.strictEqual( typeof random.factory, 'function', 'has method' ); t.end(); }); tape( 'attached to the main export is a `normalized` method', function test( t ) { t.strictEqual( typeof random.normalized, 'function', 'has method' ); t.end(); }); tape( 'attached to the main export is the underlying PRNG', function test( t ) { t.equal( typeof random.PRNG, 'function', 'has property' ); t.end(); }); tape( 'attached to the main export is the generator seed', function test( t ) { t.equal( isUint32Array( random.seed ), true, 'has property' ); t.end(); }); tape( 'attached to the main export is the generator seed length', function test( t ) { t.equal( typeof random.seedLength, 'number', 'has property' ); t.end(); }); tape( 'attached to the main export is the generator state', function test( t ) { t.equal( isUint32Array( random.state ), true, 'has property' ); t.end(); }); tape( 'attached to the main export is the generator state length', function test( t ) { t.equal( typeof random.stateLength, 'number', 'has property' ); t.end(); }); tape( 'attached to the main export is the generator state size', function test( t ) { t.equal( typeof random.byteLength, 'number', 'has property' ); t.end(); }); ```
Public Service Union is the name of: Dominica Public Service Union Public Service Union of Belize Public Service Union of Namibia Queensland Public Sector Union in Australia St. Vincent and the Grenadines Public Service Union
General Inspectorate of Maritime Affairs (Inspection générale des affaires maritimes) is a French General Inspectorate in the areas of the sea. The office is placed under the authority of the State Secretariat for the Sea. Mission The General Inspectorate of Maritime Affairs informs and advises the ministers, in particular the ministers in charge of the armed forces, ecological transition, agriculture and food sovereignty, overseas territories, for the exercise of their powers in the areas of the sea. On their behalf, it carries out a general inspection mission which relates to the regularity, quality and efficiency of the action of the services with competence in the fields of the sea, as well as an advisory mission for the operation of the services. The Inspectorate helps to monitor and guide maritime affairs administrators and maritime education teachers. The Inspector General exercises the function of Chief of the Corps of Maritime Affairs Administrators as well as the function of Chief of the Corps of Instructors of Maritime Education. Organization The Inspectorate is headed by the Inspector General of Maritime Affairs and includes an Inspector General of Maritime Education who is responsible for organizing the missions of the General Inspectorate in the field of maritime education. Inspector General of Maritime Affairs: Guillaume Sellier, Senior Administrator General of Maritime Affairs Inspector General of Maritime Education: Laurent Galy, Professor General 2nd Class Direction of the Corps of Maritime Affairs Administrators, under the Inspector General Maritime Education Inspection, under the Inspector General of Maritime Education Inspections and Audits, under Marc Chapalain, Administrator General of Maritime Affairs 2nd Class References Government agencies of France France and the Sea
St Merryn () is a civil parish and village in north Cornwall, England, United Kingdom. It is about south of the fishing port of Padstow and northeast of the coastal resort of Newquay. The village has a primary school (St Merryn School, part of Kernow Learning), a veterinary practice, various shops, restaurants, and two public houses. The population at the 2011 census was 1,692. Geography The 3,798 acre parish of St Merryn is bounded by a millstream to the south that separates it from the St Ervan and St Eval parishes; more than of coastline along the Atlantic Ocean; and the Padstow parish and Lyn stream. The Seven Bays region of St Merryn includes (from west to east) Porthcothan Bay, Treyarnon Bay, Constantine Bay, Booby's Bay, Mother Ivey's Bay, Harlyn Bay and Trevone Bay. The nearest bay to St Merryn village centre is Harlyn Bay ( north). Interesting features include the seaside cliffs, like the Marble cliffs, Tregudda gorge, Trevose Head and the collapsed cave known as Round Hole. The North Cornwall Coastal Path follows the clifftops and crosses the Seven Bays. The B3276 is the largest road passing through the Seven Bays area. Toponymy There are two theories about the namesake of the parish of St Merryn. Visit Cornwall asserts that according to local historians the village and parish are named after a Welsh missionary priest named Merryn who came to St Merryn around 650 AD. It has also been proposed that Cornwall's St Merryn was a monk named Maruanus or Maruan. Which Merryn (or alternative spelling) this may be is debatable. Regarding Merryn son of Brychan, in his 1965 book series The Saints of Cornwall the scholar Gilbert Doble disputes assertions made by Charles G. Henderson that the Merryn in question may have been the "Marwenna found in William of Worcester's list of the Children of Brychan" The benefice of St Merryn was named Vicaria Sancte Marine (the vicarage of St Marina) in 1259. It continued to be listed in church records as a form of Saint Marina until 1477 when it was named Seynt Meryn. There are two churches in France named after a Saint Marina or Marinus: Lanmérin for a male saint and the former Paris church of St Marina on the Île de la Cité. Churches named after a Celtic saint Merin include those in Llanferin, Gwent; Bodferin, Wales; and Plomelin, Brittany. Doble states that by the Middle Ages, the earlier Celtic saint was replaced by Marina of Bithynia. Alban Butler describes the celebrated Saint Marina of Bithynia as a woman who lived and died during the 8th century. In her earnestness to live the life of a monk, she dressed and assumed the persona of a man. In 1228 she was identified by William of Paris as a titular saint (existing in title only) of a church in Paris. Her feast day is 17 July. The St Merryn feast day had been changed to the Sunday nearest to 7 July, Saint Thomas of Canterbury's feast day, when the church was rededicated to "The Blessed Meran and St. Thomas à Becket" during Henry VII's rule. History St Merryn air field RNAS St Merryn operated from 1937 to 1956 was also known as HMS Vulture and HMS Curlew. Initially the airfield was built with an airstrip and one hangar for civil purposes. In 1940, following construction of buildings for military use, it became an aircraft training centre for training for airborne observers and aircraft carrier flight manoeuvres. The airfield was renamed the RNAS St Merryn, HMS Vulture at that time. The following year German aircraft bombed the field; it was rebuilt in 1942. The Ward Room was housed within the Cornish Arms Inn; there is an honour roll posted at the location commemorating the aviators of the St Merryn air field. In 1952 the HMS Curlew unit joined the airfield for Naval reserve and airborne observer training. The field was closed for military purposes in 1956. There is limited aviation on the landing strips now and some of the former airfield is used for industry, farm land and leisure activity. The control tower and other airport buildings are visible in the area. St Merryn beef shipment of 1999 In August 1999 beef from a St Merryn slaughterhouse made the national news when it was the source of the first beef from the British mainland to be served in Brussels in three years. It signalled a re-emergence of British beef in the international marketplace since bovine spongiform encephalopathy (BSE), or more commonly, Mad Cow Disease, resulted in a shut down of beef exports. The shipment, coordinated by the Meat and Livestock Commission in Britain, came three weeks after the European Union lifted its ban on the import of British beef. Religion St Merryn Church The original dedication of the church was to St Merryn but in Norman times the saint was assumed to be a St Marina (see above, Toponymy). When the sainthood of Thomas Becket (Thomas of Canterbury) was ratified by Rome in 1338, a second dedication was made to him but it did not replace the St Merryn dedication. The first resident Vicar, John de Withiel, was installed on 2 July 1259. The church building is of Norman foundation but the chancel, south aisle and upper part of the tower are of the 15th century. The font of Cataclewse stone, quarried on Trevose Head, has carved figures of the twelve Apostles; It originally belonged to the chapel of St Constantine in the parish. Charles Henderson dated it as c. 1420 and gives the date of rebuilding the chancel as 1422. The north transept was built about the 13th century. The piers of the aisle are also of Cataclewse stone. St Merryn Church has a 'wagon roof' built in 1422 and a tower with six bells. The 15th century church expansion included the addition of a south aisle of seven bays. The plaster coat of arms of Charles II, commissioned in 1662 by Harlyn House's Thomas Peter, is located near the tower. The church renovations occurred over two periods: once between 1887 and 1907 and again in 1962, when the west tower was rebuilt. The church became a Grade II building on 6 June 1969 and a Grade II* building on 20 May 1988. Jonathan Toup was a prominent Vicar of St Merryn, 1776–1785. A small marble tablet erected to his memory by his niece Phillis Blake is on the south wall of the church. The tablet, which states that Toup's scholarship was "known to the learned throughout Europe," had funding from the delegates of the Oxford University Press. When the Diocese of Truro was formed from the Archdeaconry of Cornwall in the Diocese of Exeter on 15 December 1876 St Merryn Church was included in the new diocese. The annual summer Church Fete "Roses Day Fun" is on Feast Day Sunday (nearest Sunday to 7 July), with stalls and activities in 'The Young Men's Green'. St Constantine chapel ruins The ruins of the Medieval St Constantine chapel include what is likely the high walls of the west tower. The shale and slate stone church was estimated to have been with a "nave and chancel, south aisle and west tower". The chapel was re-roofed in 1290, on orders from the Bishop of Exeter so the Vicar of St Merryn could hold mass on Sundays, Wednesdays and Fridays. The chapel's font is now in the parish church at St Merryn. Near the chapel ruins is a holy well which was uncovered in 1911. Taking the waters there was said to bring rain during dry weather. The ruins of the chapel still exist in the dunes (now a golf course) near Trevose. St Merryn Methodist Church The St Merryn Methodist Church is a Wesleyan Methodist chapel which was completed in 1905. It is a single-storied, Arts and Crafts building with a rectangular plan, 2 light windows and a slate roof. The Grade II building was listed with the British Listed Buildings on 20 May 1988. The original early 19th century chapel, made of stone rubble with a slate roof, was also a single-storied building with a rectangular plan. The building, with a two-windowed front and that sits close to the road, is now the site of an arts and crafts centre. The Grade II building was listed on 20 May 1988. Culture In 1507 Thomas de Tregew donated a small field to "the youth of St Merryn for the celebration of Cornish sports". At that time the sports in question were Cornish wrestling and kales. St Merryn is one of the places where Kayling was traditionally played. This game, similar to skittles, was played in the locality from at least the 16th century until the 20th century. St Merryn was also one of the last villages to have a traditional cornish hurling match as part of their annual village festival, this being in honour of St Constantine. In the summer, St. Merryn hosts a number of activities including the Great Atlantic Raft Race, St Merryn Vintage Steam Rally, St Merryn Carnival and other local festivals and community events. 'The Amazing Maize Maze' is sometimes held in the area. The Community Hall hosts auctions and events. Cornish wrestling St Merryn has traditionally hosted many Cornish wrestling tournaments, for prizes, with records of tournaments going back to 1814. The traditional place for tournaments was the de Tregew field. More recently there have been tournaments for prize money in the Green near the Drill Hall, in the field behind the Farmers' Arms and at the St Merryn Steam Rally. In 1965, St Merryn hosted the Interceltic games. Economy The past industries include tin-mining, smuggling, and fishing. Now, farming and tourism are the prime industries. A mineral lode including Lead ore (Galena) and Copper ore (Chalcopyrite) runs within half a mile of St Merryn church, and from 1823 this was mined by Wheal Friendship mine, initially for silver. There was a further open cut on the same lode known as Trevorgus Mine sited south west of St Merryn, and in 1834 these amalgamated as Trevorgus and Treveglos Mines. The combined mine was abandoned in 1839, but in 1838 it produced only 24 tons of Lead Ore. There are two old public houses in St Merryn, Farmers Arms Inn and Cornish Arms; the latter was taken over in 2009 by celebrity chef Rick Stein. Tourism Most of the Seven bays have lifeguard facilities, car parks, and public toilets during the summer months. Lodging choices include houses to let, hotels, caravan parks, holiday home parks, and campsites. About inland, on former St Merryn Airfield land, is land used for farming and leisure activity, like the Atlantic Bays, St Merryn Holiday Village and Maribou holiday home parks. Notable people Kenneth Gray, was made OBE for efforts for Age Concern and other community service programmes. William Peter, British diplomat and politician Johnny Cowling, Cornish comedian Bridget Riley CH CBE artist and academic Notes References Further reading Malcolm McCarthy. St Merryn Through Time. Amberley Publishing. . External links Historical information on St Merryn from Genuki Farmers Arms Cornwall Cornwall Record Office Online Catalogue for St Merryn Civil parishes in Cornwall Villages in Cornwall
```css Disable resizable property of `textarea` Select items using negative `nth-child` Styling elements using `::before` and `::after` Disclose file format of links Debug with `*` selector ```
```yaml title: Operations and Support - SQL Server 2019 Big Data Clusters description: A collection of notebooks to help operate and support SQL Server Big Data Clusters. ```
```html <div class="modal-header success"> <h5 class="modal-title" id="modal-title"> Choose connection <a class="modal-close pull-right" ng-click="close()"> <i class="mdi mdi-close"></i> </a> </h5> </div> <div class="modal-body" ng-if="alerts.length"> <!--<p>Choose a connection</p>--> <div class="no-margin" uib-alert ng-repeat="alert in alerts" ng-class="'alert-' + (alert.type || 'warning')" close="closeAlert($index)">{{alert.msg}}</div> </div> <table class="table table-hover"> <tr> <th width="1"></th> <th>name</th> <th>Kong admin URL</th> <th>Kong version</th> </tr> <tr data-ng-repeat="connection in connections" class="clickable" data-ng-click="activateConnection(connection)" > <td width="1"> <div data-ng-if="connection.checkingConnection"> <fading-circle-spinner class="spinner"></fading-circle-spinner> </div> <div data-ng-if="!connection.checkingConnection"> <input type="checkbox" ng-checked="user.node.id == connection.id"> <!--<i class="material-icons text-primary">{{user.node.id == connection.id ? '&#xE834;' : '&#xE835;'}}</i>--> </div> </td> <td><strong>{{connection.name}}</strong></td> <td>{{connection.kong_admin_url}}</td> <td>{{connection.kong_version.split("-").join(".")}}</td> </tr> </table> ```
Nancy Jewel McDonie (born April 13, 2000), known professionally as Nancy (), is a Korean-American singer, actress, and host. She is a former member of the South Korean girl group Momoland, which was formed on November 10, 2016, through the Mnet's reality survival show Finding Momoland. In 2023, she also began performing in live musical theater. Early life Nancy's father, Richard Jowel McDonie is from Columbus, Ohio, and served in the United States Army for twenty years. In the 1990s he was promoted to Colonel and stationed in Korea. He went on a blind date with Lee Myeong-ju, a Korean woman, originally from Yongin, Gyeonggi-do, who was volunteering at the base, and they soon married. In November 1998 their first child, later to become a cellist, Brenda, was born, and on April 13, 2000, the second daughter, Nancy, was born in Nam-gu, Daegu, South Korea. In 2001 the family moved to the father's hometown of Columbus, Ohio, where Nancy spent her early years and attended school. In an interview about her being of mixed origin and the product of two cultures Nancy said, "I have always been told by my parents that there are two cultures that I am in contact with ever since I was a child." On March 20, 2019, it was reported that Nancy changed her Korean legal name to Lee Geu-roo from Lee Seung-ri. Education She graduated from Hanlim Multi Art School on February 9, 2018, where she was a student in the Musical Department. Career Pre-debut Nancy auditioned in Korea's Got Talent as part of a hip-hop group called "Cutie Pies" in 2011. The group reached the semi-finals. As a teenager, she appeared in several TV programs, including The Unlimited, and also participated in Mak Ee Rae Show: Just Do It Expedition in 2012, in which she traveled to the Philippines and Saipan with South Korean actress Kim Yoo-jung. 2016: Finding Momoland, debut with Momoland, and Sunny Girls In 2016, Nancy became a contestant on Mnet's reality survival show Finding Momoland to select the members of MLD Entertainment's new girl group Momoland. She finished the competition in first place, and had her debut with the group on November 10, 2016, with the mini-album Welcome to Momoland. Momoland made their debut stage performing at M Countdown. On November 19, it was announced that she would join Inkigayo's project girl group Sunny Girls along with GFriend's Eunha, WJSN's Cheng Xiao, Oh My Girl's YooA and Gugudan's Nayoung. They made their official debut at SBS's Inkigayo stage, on November 27, with the title track "Taxi". The group also performed at the 2016 SBS Gayo Daejeon on December 26. 2017–present: Acting activities and recognition In 2017, Nancy was cast in the lead role with boy band ZE:A member Ha Min-woo in Naver TV's web music drama series Some Light. Nancy and Ha Min-woo also collaborated for the theme song of the drama series. Nancy was selected to host the music show The Power of K alongside U-Kwon and Shownu. The show began airing in Japan and Korea in January 2018. On January 3, 2018, Momoland released their third mini-album, Great!. As a result, the lead single, "Bboom Bboom", was a huge commercial success, reaching number two on the Gaon Digital Chart. On June 26, 2018, Momoland released their fourth mini-album Fun to the World with the lead single "Baam" becoming the 15th best-selling song of July 2018 on Gaon Music Chart. In October 2018, Nancy appeared in episode 11 of MBC's Dae Jang Geum is Watching, alongside her fellow-members JooE, Hyebin and Daisy as idol trainees. On January 27, 2023, it was announced that Nancy, along with the Momoland members, departed from MLD Entertainment following expiration of the contracts. Momoland officially announced their disbandment on February 14. On March 4, Nancy announced that she signed a contract with Aria Diamond, a newly established talent agency affiliated with Aria Group, through her personal Instagram account. On September 17, Nancy revealed via Instagram that she is no longer an artist under Aria Group. On September 21, it was confirmed that Nancy has signed an exclusive contract with ATOC. Other ventures Acting In September 2017 Nancy announced on her Instagram account that she would be appearing in the live musical "The Show! ShillaHada", which depicts the story of Cheoyoung who unites the ancient Korean kingdom of Shillia. Nancy plays two characters: Lee Chae Rin of the present time, and also the role of Princess Seungman in the Silla period. Endorsements In January 2020, Nancy was chosen as the new endorsement model for the popular skincare brand Some By Mi, A representative of Some By Mi said that they chose Nancy was because "her healthy and pure image fit well with the direction that we pursue, of our clean, natural skincare products". Filmography Television series Web series Television shows Hosting Discography Soundtrack appearances References External links Official website 2000 births Living people Musicians from Daegu Actresses from Daegu South Korean female idols South Korean female dancers Momoland members South Korean web series actresses American people of Irish descent American people of South Korean descent South Korean people of American descent South Korean people of Irish descent 21st-century South Korean actresses 21st-century South Korean women singers Hanlim Multi Art School alumni
Ibo District is a small district of Cabo Delgado Province in northern Mozambique. Its principal town is Vila do Ibo on Ibo Island. External links Government profile Districts in Cabo Delgado Province
```turing #! /usr/bin/env perl # # in the file LICENSE in the source distribution or at # path_to_url use OpenSSL::Test::Simple; simple_test("test_hmac", "hmactest"); ```
"That's Why Darkies Were Born" was a popular song written by Ray Henderson and Lew Brown. It originated in George White's Scandals of 1931, where white baritone Everett Marshall performed the song in blackface. The song was most famously recorded by popular singer Kate Smith, whose rendition was a hit in 1931, and by award-winning singer, film star, scholar, and civil rights activist Paul Robeson. It was also featured in a 1931 all-star recording of a medley of songs from George White's Scandals, where it was sung by Frank Munn on Brunswick and just as famously part of Paul Whiteman medley sung by Native American jazz singer Mildred Bailey on Victor. One verse runs: Someone had to pick the cotton, Someone had to plant the corn, Someone had to slave and be able to sing, That's why darkies were born. The song was part of a fatalistic musical genre in the 1930s where African Americans were depicted as "fated to work the land, fated to be where they are, to never change." "That's Why Darkies Were Born" has been described as presenting a satirical view of racism, although others have said there is no evidence that the song was ever performed in a satirical or joking manner. The song was criticized as racist by African American audiences in the early 1930s, and Mildred Bailey received many letters from the public urging her to stop performing it in 1931. In popular culture The song is referenced in the Marx Brothers film Duck Soup, when Groucho Marx's character Rufus T. Firefly says, "My father was a little headstrong, my mother was a little armstrong. The Headstrongs married the Armstrongs, and that's why darkies were born." Part of Marx's line, primarily the term "darkies," was removed from television prints of this film in the early 1970s. The full dialogue was restored in 1980 for home video releases and future broadcast syndication. 2019 controversy On April 18, 2019, the New York Yankees announced that Kate Smith's rendition of "God Bless America" would no longer be played at Yankee Stadium, citing "That's Why Darkies Were Born" along with another controversial song sung by Smith, "Pickaninny Heaven". The Philadelphia Flyers followed suit the next day, covering up a statue of Smith that stood outside the Wells Fargo Center, then removing the statue on April 21, 2019. References External links via Lyon College Paul Robeson - That's Why Darkies Were Born - 1931 via YouTube Kate Smith - That's Why Darkies Were Born - 1931 via YouTube American songs 1931 songs Paul Robeson songs Kate Smith songs Songs with music by Ray Henderson Songs with lyrics by Lew Brown Satirical songs Comedy songs Ethnic humour Stereotypes of African Americans Songs about black people Black comedy music Race-related controversies in music
```java /* * * * path_to_url * * Unless required by applicable law or agreed to in writing, * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * specific language governing permissions and limitations */ package org.ballerinalang.langserver.commons; import org.eclipse.lsp4j.PublishDiagnosticsParams; import java.util.List; /** * Represents a completion extension. * * @since 2.0.0 */ public interface DiagnosticsExtension extends LanguageExtension<String, List<PublishDiagnosticsParams>, DocumentServiceContext> { /** * {@inheritDoc} */ @Override default LanguageFeatureKind kind() { return LanguageFeatureKind.DIAGNOSTIC; } } ```
Death Before Dishonor X: State of Emergency (DBD X) was the tenth Death Before Dishonor professional wrestling internet pay-per-view (iPPV) event produced by Ring of Honor (ROH). It took place on September 15, 2012, at the Frontier Fieldhouse in Chicago Ridge, Illinois. Storylines DBD X featured professional wrestling matches which involve different wrestlers from pre-existing scripted feuds, plots, and storylines that played out on ROH's television programs. Wrestlers portrayed villains or heroes as they followed a series of events that built tension and culminated in a wrestling match or series of matches. Results See also ROH Death Before Dishonor References External links Ring of Honor's official website Ring of Honor pay-per-view events Events in Chicago Professional wrestling in the Chicago metropolitan area 2010s in Chicago 2012 in Illinois 10 September 2012 events in the United States 2012 Ring of Honor pay-per-view events
Pneumodesmus newmani is a species of myriapod that lived during the late Wenlock epoch of the Silurian period around . Although a 2017 study dates its occurrence based on zircon data analysis as the Early Devonian (Lochkovian), the 2023 study confirmed the age identification of the 2004 study through palynological, palaeobotanical and ziron analyses incorporating newly discovered additional data. It is one of the first myriapods, and among the oldest creatures to have lived on land. It was discovered in 2004, and is known from a single specimen from Stonehaven, Aberdeenshire, Scotland. Discovery and naming The fossil of P. newmani was found by Mike Newman, a bus driver and amateur palaeontologist from Aberdeen, in a layer of sandstone rocks on the foreshore of Cowie, near Stonehaven (Cowie Formation). The species was later given the specific epithet "newmani" in honour of Newman. The holotype is kept in National Museum of Scotland, Edinburgh. The genus name is said to be derived from the Greek pneumato, meaning "air" or "breath", in reference to the inferred air-breathing habit. The proper word in ancient Greek for "air" or "breath" is however pneuma (πνεῦμα). Description The single, 1 cm-long fragment of P. newmani depicts small paranota (keels) high on the body, long, slender legs. There are six body segments preserved, and the dorsal portion of each segment is ornamented with a horizontal bar and three rows of roughly hexagonal bosses (bumps). Myriapods are the group that include millipedes and centipedes, and Pneumodesmus newmani would have resembled a millipede in appearance. However it did not belong to the same branch of myriapods as modern millipedes. Significance The fossil is important because its cuticle contains openings which are interpreted as spiracles, part of a gas exchange system that would only work in air. This makes P. newmani the earliest documented arthropod with a tracheal system, and among the first known oxygen-breathing animal on land. Trace fossils of myriapods are known dating back to the late Ordovician (the geologic period preceding the Silurian), but P. newmani may be the earliest body fossil of a myriapod, if it had been dated at (Silurian, late Wenlock epoch to early Ludlow epoch). However, if based on (Early Devonian (Lochkovian)) estimated from Zircon age estimate, it cannot be called as the oldest myriapod, or the oldest of air-breathing terrestrial arthropods, because records from Kerrera (425 millions years ago) and Ludlow (420 millions years ago) become older than that. In spite of the recent competing arguments, the 2023 study suggests that this taxon is still most likely the earliest body fossil of a myriapod, with its age reconfirmed as the late Wenlock epoch (around ) through various analyses. During the Silurian, the rocks that would later be part of Scotland were being laid down on the continent of Laurentia, in a tropical part of the Southern Hemisphere. References Silurian myriapods Prehistoric myriapod genera †Pneumodesmus Paleozoic arthropods of Europe Fossil taxa described in 2004 Fossils of Scotland Stonehaven History of Aberdeenshire Collections of National Museums Scotland
Aasha Davis (born August 17, 1973) is an American actress best known for her roles as Waverly Grady on Friday Night Lights and Chelsea Lewis on South of Nowhere. Career Davis is best known for playing the role of Waverly Grady on Friday Night Lights. She has also appeared in Gilmore Girls, Grey's Anatomy, House, ER, Castle, and The Shield. Davis was featured in Gnarls Barkley's music video for "Who's Gonna Save My Soul" in mid 2008. In 2011, she played opposite Adepero Oduye in the film Pariah. In 2012, she guest-starred in the second season of the Jane Espenson-scripted romantic comedy web series Husbands. Most recently, Aasha is producing and starring in a web series featured on YouTube called The Unwritten Rules, which is based on series creator Kim Williams's book 40 Hours and an Unwritten Rule: The Diary of an African-American Woman. In 2019, Aasha starred as Bernadette in the rural Louisiana murder mystery The Long Shadow. Personal life In 2002, Davis married Jesse Pforzheimer They have one son, Ever, born in January, 2009. Davis's older sister, Lesley Herring, disappeared in Los Angeles on February 8, 2009, after a fight with her husband, Lyle Stanford Herring, Sr. Davis reported her sister as missing when she failed to show up to work, her husband having neglected to do so. Lyle Herring was charged with his wife's murder and in April 2010 pleaded not guilty. On April 8, 2013, he was convicted of the second-degree murder of his wife. To date, her body has not been found. A 2011 episode of Nancy Grace and a June 7, 2013, episode of Dateline NBC covered Davis's sister's case. Filmography Film Television References External links Living people American television actresses 1974 births 21st-century American actresses American film actresses African-American actresses 21st-century African-American women 21st-century African-American people 20th-century African-American people 20th-century African-American women
Pipo en de P-P-Parelridder (English translation: Pipo and the p-p-Pearl Knight) is a 2003 Dutch movie based on the children's television show Pipo de Clown. The film received a Golden Film for having drawn 100,000 visitors. Background From the late 1950s on, Pipo de Clown was one of the earliest and most popular children's television shows in the Netherlands. The show finally ended in 1980. In the late 1990s, the return of Pipo was touched upon when television talk show host Ivo Niehe interviewed Belinda Meuldijk, the daughter of Pipo's creator (Wim Meuldijk), and her husband, singer Rob de Nijs. Niehe tried to sell the idea to various broadcasters but without success, and the rights were bought by Endemol. Auditions were held, and Joep Dorren was chosen as the new Pipo. The script for a pilot and for six episodes was written, and the 40-minute-long pilot (filmed in 1999 on Rob de Nijs's estate) proved very popular, selling 100,000 copies on video; still, the public broadcasting corporations had no faith in Pipo's chance of success and thought it would be too expensive. In the end Endemol decided to make the series into a feature movie, Pipo en de p-p-parelridder, directed by Martin Lagestee and with a script by Wim Meuldijk. Production and cast The script is loosely based on a 1960 Pipo TV series, Pipo en de Slaapridder, which was filmed on location for 9000 guilders. The movie was filmed in Spain for around €3.5 million and premiered in November 2003. The role of Snuf, one of the two crooks, was played by Rudi Falkenhagen, age 72. Falkenhagen was the last survivor of the original television show and Snuf was his first big role. He died two years later. Tara Elders, who starred in a number of Theo van Gogh movies, plays the part of the titular character's lady lover. Plot Pipo receives a letter from Aunt Anouschka, asking him for help with mysterious events in a nearby castle which appears to be haunted. Pipo leaves the circus in the hands of his wife Mamaloe and daughter Petra, to the chagrin of circus director Dikke Deur —a circus without Pipo sells fewer tickets. When Pipo arrives at the castle there is no ghost; instead, he finds a knight who has been asleep for 500 years. He is awakened, but the next problem is finding and waking his lady lover, who has also been asleep that long. Investment and payout The movie cost about €3.5 million to make. It brought in €692,665 in 2003 and €815,120 in 2004. Sequel In 2007, rumors circulated that a second Pipo film was to be made, Pipo & Het Geheim Van De Barkini Driehoek, written by Meuldijk and directed by Lagestee, with Joep Dorre returning as Pipo. The Indian Klukkluk, notably absent from Pipo en de p-p-Parelridder, was to make his return. The movie, according to Meuldijk, was to be released at the end of 2008. However, Meuldijk died in 2007, and though a musical, Pipo en de Gestolen Stem, was produced in 2009, no movie has been released. References External links 2003 films 2000s Dutch-language films Dutch children's films Films based on television series Films shot in Spain Comedy films about clowns Circus films
```smalltalk " `AthensCanvas` instance is a central object which is used to perform drawings on a surface. Please note, that Athens does not allow you to instantiate canvas directly, instead you obtain a ready to use instance as an argument in `#drawDuring:` message, sent to athens surface: ``` surface drawDuring: [:canvas | .... ] ``` Using canvas outside a `#drawDuring:` method is highly discouraged. Doing so may lead to unpredicted behavior/data corruption/image crash. " Class { #name : 'AthensCanvas', #superclass : 'Object', #instVars : [ 'paint', 'surface', 'shape', 'fontRenderer', 'paintMode', 'paintCache' ], #category : 'Athens-Core-Base', #package : 'Athens-Core', #tag : 'Base' } { #category : 'instance creation' } AthensCanvas class >> new [ self error: 'An AthensCanvas are created with on:' ] { #category : 'private' } AthensCanvas class >> on: aSurface [ ^ self basicNew initializeWithSurface: aSurface ] { #category : 'caching' } AthensCanvas >> cacheAt: anObject ifAbsentPut: aBlock [ ^ surface cacheAt: anObject ifAbsentPut: aBlock ] { #category : 'clipping' } AthensCanvas >> clipBy: aRectangle during: aBlock [ "Set a clipping rectangle during drawing operations performed in aBlock. Note that the clipping rectangle is intersected with the currently active clipping rectangle" ^surface clipBy: aRectangle during: aBlock ] { #category : 'paths' } AthensCanvas >> createPath: aPathCreatingBlock [ "Create new path. A path creating block should be a monadic block, which will get a path builder instance as argument. See AthensPathBuilder for available protocol. The resulting path object can be later used for drawing. " ^ surface createPath: aPathCreatingBlock ] { #category : 'paths' } AthensCanvas >> createRectanglePath: aRectangle [ ^ surface createRectanglePath: aRectangle ] { #category : 'masking' } AthensCanvas >> disableMask [ ^ surface disableMask ] { #category : 'drawing' } AthensCanvas >> draw [ "Fill the currently selected shape with currently selected paint" ^ shape paintFillsUsing: paint on: self ] { #category : 'drawing' } AthensCanvas >> draw: anObject [ "A generic dispatch method to draw anObject on receiver. the object should understand #drawOnAthensCanvas: message" ^ anObject drawOnAthensCanvas: self ] { #category : 'drawing' } AthensCanvas >> drawShape: anObject [ "A convenience method, which sets the current shape to anObject and then fills it with currently selected paint" self setShape: anObject; draw ] { #category : 'drawing text' } AthensCanvas >> drawString: aString [ "Draw a string using currently selected font. Answer a total advance of rendered string " ^ fontRenderer renderCharacters: aString from: 1 to: aString size ] { #category : 'drawing text' } AthensCanvas >> drawString: aString from: start to: end [ "Draw a portion of string using currently selected font. Answer a total advance of rendered portion" ^ fontRenderer renderCharacters: aString from: start to: end ] { #category : 'masking' } AthensCanvas >> enableMask [ ^ surface enableMask ] { #category : 'caching' } AthensCanvas >> flushCacheAt: anObject [ "Flush (delete) any cached value(s) identified by given object, anObject. A surface using identity comparison for object identifiers. Answer receiver. " surface flushCacheAt: anObject ] { #category : 'initialization' } AthensCanvas >> initializeWithSurface: anAthensSurface [ surface := anAthensSurface ] { #category : 'clipping' } AthensCanvas >> isVisible: aRectangle [ "Check if rectangle are not fully clipped by current clipping coordinates" ^ true ] { #category : 'accessing' } AthensCanvas >> paint [ ^ paint ] { #category : 'paint' } AthensCanvas >> paintCache [ ^ paintCache ifNil: [ paintCache := LRUCache new maximumWeight: 100 ] ] { #category : 'accessing' } AthensCanvas >> paintMode [ "Answer the current paint mode controller. The answered object should conform to AthensPaintMode public protocol." ^ paintMode ] { #category : 'transformation matrices' } AthensCanvas >> paintTransform [ "Answer the paint transformation matrix controller. The answered object should conform to AthensTransform public protocol." ^ surface paintTransform ] { #category : 'transformation matrices' } AthensCanvas >> pathTransform [ "Answer the path transformation matrix controller. The answered object should conform to AthensTransform public protocol." ^ surface pathTransform ] { #category : 'drawing text' } AthensCanvas >> setFont: aFont [ "Set the current font of receiver. Font object should answer a glyph renderer instance, compatible with glyph renderer protocol" ^ fontRenderer := aFont glyphRendererOn: surface ] { #category : 'paint' } AthensCanvas >> setPaint: aPaint [ "set the current paint of receiver" paint = aPaint ifTrue:[ ^ paint ]. paint := self paintCache at: aPaint ifAbsentPut: [ aPaint asAthensPaintOn: self ]. ^ paint ] { #category : 'accessing' } AthensCanvas >> setShape: anObject [ "Set the current shape of receiver" shape := anObject asAthensShapeOn: self ] { #category : 'paint' } AthensCanvas >> setStrokePaint: aPaint [ "use paint as stroke paint, note conversion to #asStrokePaintOn:" paint := (aPaint asAthensPaintOn: self) asStrokePaintOn: self. ^ paint ] { #category : 'accessing' } AthensCanvas >> surface [ "Answer an Athens surface, to which receiver is bound to" ^ surface ] ```
"When the Year Ends in One" was a single released by the English football team Tottenham Hotspur, with uncredited accompaniment by Chas & Dave, who composed the song, writing new lyrics to the tune of their 1982 song "London Girls" and former Lieutenant Pigeon manager David Whitehouse, to celebrate reaching the 1991 FA Cup Final. It reached number 44 in the UK Singles Chart. The title of the song refers to the fact that during the twentieth century, the club won a number of major trophies, in particular the FA Cup, several times in years ending in 1. They continued the trend by going on to win the 1991 Final. "When the year ends in 1" has become a general superstition for supporters, although Tottenham have not won a trophy in such a year since 1991. The major trophies to which the song and the superstition apply are: 1901 FA Cup 1921 FA Cup 1951 Football League First Division 1961 Football League First Division and FA Cup ("the Double") 1971 League Cup 1981 FA Cup 1991 FA Cup References 1991 singles Tottenham Hotspur F.C. songs Association football songs and chants 1991 songs Song articles with missing songwriters
Static Taxi was a post-punk band formed in the late 1980s, later joined by Bob Stinson, former lead guitarist of The Replacements. They were so-called because two members of the band worked part-time as taxi drivers. Two years after leaving the Replacements, Stinson joined Static Taxi in the summer of 1988 with two younger friends, drummer John Reipas and bassist/vocalist Ray Reigstad. Stinson had been jamming informally with Riegstad and Reipas for a couple of years previously, playing cover versions of 1970s pop songs, even while he was still a member of the Replacements. They became a quartet when they recruited bass player Chris Corbett. The band rehearsed tirelessly over the next few years, and developed an extensive catalog of original songs and cover versions. Their headquarters was the office of an abandoned grain elevator near the University of Minnesota campus in southeast Minneapolis. Later, they moved to one of several boxcars which the owner of the grain elevator kept on a railroad siding behind his property and rented out to various artists and musicians. The grain elevator was home to a number of homeless veterans, including one named "Hillbilly" who sang the lead on the band's recording of their song "Hillbilly's Lament." Static Taxi recorded a large amount of material, some of it on professional studio equipment, and at some point, Stinson brought some demo tapes to the Replacements' old label Twin/Tone. The label refused to sign the band, reportedly because they thought Reigstad's singing was off-key. Aside from a brief trip to Las Vegas in 1989, the band's live shows were limited to the local Twin Cities area. Videos of just two of their live shows have surfaced on video-sharing sites such as YouTube: a 1989 show in Las Vegas where they are performing before a small but enthusiastic crowd at a little club, and a 1990 performance where they entertained the employees of a local Twin Cities restaurant at its annual staff party. The band broke up in 1991, around the same time the Replacements broke up. Stinson died in 1995. Vocalist Ray Reigstad went on to form the band Stepchild. Two albums have been posthumously compiled from the band's recordings. In 2000, "Stinson Blvd" was released on Rock X-Change Records. In 2003 Birdman Records released "Closer2Normal." References Musical groups from Minnesota
```go // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package kms import ( "fmt" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) const opCancelKeyDeletion = "CancelKeyDeletion" // CancelKeyDeletionRequest generates a "aws/request.Request" representing the // client's request for the CancelKeyDeletion operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See CancelKeyDeletion for more information on using the CancelKeyDeletion // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the CancelKeyDeletionRequest method. // req, resp := client.CancelKeyDeletionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) CancelKeyDeletionRequest(input *CancelKeyDeletionInput) (req *request.Request, output *CancelKeyDeletionOutput) { op := &request.Operation{ Name: opCancelKeyDeletion, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &CancelKeyDeletionInput{} } output = &CancelKeyDeletionOutput{} req = c.newRequest(op, input, output) return } // CancelKeyDeletion API operation for AWS Key Management Service. // // Cancels the deletion of a KMS key. When this operation succeeds, the key // state of the KMS key is Disabled. To enable the KMS key, use EnableKey. // // For more information about scheduling and canceling deletion of a KMS key, // see Deleting KMS keys (path_to_url // in the Key Management Service Developer Guide. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:CancelKeyDeletion (path_to_url // (key policy) // // Related operations: ScheduleKeyDeletion // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation CancelKeyDeletion for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // See also, path_to_url func (c *KMS) CancelKeyDeletion(input *CancelKeyDeletionInput) (*CancelKeyDeletionOutput, error) { req, out := c.CancelKeyDeletionRequest(input) return out, req.Send() } // CancelKeyDeletionWithContext is the same as CancelKeyDeletion with the addition of // the ability to pass a context and additional request options. // // See CancelKeyDeletion for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) CancelKeyDeletionWithContext(ctx aws.Context, input *CancelKeyDeletionInput, opts ...request.Option) (*CancelKeyDeletionOutput, error) { req, out := c.CancelKeyDeletionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opConnectCustomKeyStore = "ConnectCustomKeyStore" // ConnectCustomKeyStoreRequest generates a "aws/request.Request" representing the // client's request for the ConnectCustomKeyStore operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See ConnectCustomKeyStore for more information on using the ConnectCustomKeyStore // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the ConnectCustomKeyStoreRequest method. // req, resp := client.ConnectCustomKeyStoreRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) ConnectCustomKeyStoreRequest(input *ConnectCustomKeyStoreInput) (req *request.Request, output *ConnectCustomKeyStoreOutput) { op := &request.Operation{ Name: opConnectCustomKeyStore, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &ConnectCustomKeyStoreInput{} } output = &ConnectCustomKeyStoreOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // ConnectCustomKeyStore API operation for AWS Key Management Service. // // Connects or reconnects a custom key store (path_to_url // to its backing key store. For an CloudHSM key store, ConnectCustomKeyStore // connects the key store to its associated CloudHSM cluster. For an external // key store, ConnectCustomKeyStore connects the key store to the external key // store proxy that communicates with your external key manager. // // The custom key store must be connected before you can create KMS keys in // the key store or use the KMS keys it contains. You can disconnect and reconnect // a custom key store at any time. // // The connection process for a custom key store can take an extended amount // of time to complete. This operation starts the connection process, but it // does not wait for it to complete. When it succeeds, this operation quickly // returns an HTTP 200 response and a JSON object with no properties. However, // this response does not indicate that the custom key store is connected. To // get the connection state of the custom key store, use the DescribeCustomKeyStores // operation. // // This operation is part of the custom key stores (path_to_url // feature in KMS, which combines the convenience and extensive integration // of KMS with the isolation and control of a key store that you own and manage. // // The ConnectCustomKeyStore operation might fail for various reasons. To find // the reason, use the DescribeCustomKeyStores operation and see the ConnectionErrorCode // in the response. For help interpreting the ConnectionErrorCode, see CustomKeyStoresListEntry. // // To fix the failure, use the DisconnectCustomKeyStore operation to disconnect // the custom key store, correct the error, use the UpdateCustomKeyStore operation // if necessary, and then use ConnectCustomKeyStore again. // // # CloudHSM key store // // During the connection process for an CloudHSM key store, KMS finds the CloudHSM // cluster that is associated with the custom key store, creates the connection // infrastructure, connects to the cluster, logs into the CloudHSM client as // the kmsuser CU, and rotates its password. // // To connect an CloudHSM key store, its associated CloudHSM cluster must have // at least one active HSM. To get the number of active HSMs in a cluster, use // the DescribeClusters (path_to_url // operation. To add HSMs to the cluster, use the CreateHsm (path_to_url // operation. Also, the kmsuser crypto user (path_to_url#concept-kmsuser) // (CU) must not be logged into the cluster. This prevents KMS from using this // account to log in. // // If you are having trouble connecting or disconnecting a CloudHSM key store, // see Troubleshooting an CloudHSM key store (path_to_url // in the Key Management Service Developer Guide. // // # External key store // // When you connect an external key store that uses public endpoint connectivity, // KMS tests its ability to communicate with your external key manager by sending // a request via the external key store proxy. // // When you connect to an external key store that uses VPC endpoint service // connectivity, KMS establishes the networking elements that it needs to communicate // with your external key manager via the external key store proxy. This includes // creating an interface endpoint to the VPC endpoint service and a private // hosted zone for traffic between KMS and the VPC endpoint service. // // To connect an external key store, KMS must be able to connect to the external // key store proxy, the external key store proxy must be able to communicate // with your external key manager, and the external key manager must be available // for cryptographic operations. // // If you are having trouble connecting or disconnecting an external key store, // see Troubleshooting an external key store (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a custom key // store in a different Amazon Web Services account. // // Required permissions: kms:ConnectCustomKeyStore (path_to_url // (IAM policy) // // Related operations // // - CreateCustomKeyStore // // - DeleteCustomKeyStore // // - DescribeCustomKeyStores // // - DisconnectCustomKeyStore // // - UpdateCustomKeyStore // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation ConnectCustomKeyStore for usage and error information. // // Returned Error Types: // // - CloudHsmClusterNotActiveException // The request was rejected because the CloudHSM cluster associated with the // CloudHSM key store is not active. Initialize and activate the cluster and // try the command again. For detailed instructions, see Getting Started (path_to_url // in the CloudHSM User Guide. // // - CustomKeyStoreInvalidStateException // The request was rejected because of the ConnectionState of the custom key // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores // operation. // // This exception is thrown under the following conditions: // // - You requested the ConnectCustomKeyStore operation on a custom key store // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid // for all other ConnectionState values. To reconnect a custom key store // in a FAILED state, disconnect it (DisconnectCustomKeyStore), then connect // it (ConnectCustomKeyStore). // // - You requested the CreateKey operation in a custom key store that is // not connected. This operations is valid only when the custom key store // ConnectionState is CONNECTED. // // - You requested the DisconnectCustomKeyStore operation on a custom key // store with a ConnectionState of DISCONNECTING or DISCONNECTED. This operation // is valid for all other ConnectionState values. // // - You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation // on a custom key store that is not disconnected. This operation is valid // only when the custom key store ConnectionState is DISCONNECTED. // // - You requested the GenerateRandom operation in an CloudHSM key store // that is not connected. This operation is valid only when the CloudHSM // key store ConnectionState is CONNECTED. // // - CustomKeyStoreNotFoundException // The request was rejected because KMS cannot find a custom key store with // the specified key store name or ID. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - CloudHsmClusterInvalidConfigurationException // The request was rejected because the associated CloudHSM cluster did not // meet the configuration requirements for an CloudHSM key store. // // - The CloudHSM cluster must be configured with private subnets in at least // two different Availability Zones in the Region. // // - The security group for the cluster (path_to_url // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound // rules and the Destination in the outbound rules must match the security // group ID. These rules are set by default when you create the CloudHSM // cluster. Do not delete or change them. To get information about a particular // security group, use the DescribeSecurityGroups (path_to_url // operation. // // - The CloudHSM cluster must contain at least as many HSMs as the operation // requires. To add HSMs, use the CloudHSM CreateHsm (path_to_url // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey // operations, the CloudHSM cluster must have at least two active HSMs, each // in a different Availability Zone. For the ConnectCustomKeyStore operation, // the CloudHSM must contain at least one active HSM. // // For information about the requirements for an CloudHSM cluster that is associated // with an CloudHSM key store, see Assemble the Prerequisites (path_to_url#before-keystore) // in the Key Management Service Developer Guide. For information about creating // a private subnet for an CloudHSM cluster, see Create a Private Subnet (path_to_url // in the CloudHSM User Guide. For information about cluster security groups, // see Configure a Default Security Group (path_to_url // in the CloudHSM User Guide . // // See also, path_to_url func (c *KMS) ConnectCustomKeyStore(input *ConnectCustomKeyStoreInput) (*ConnectCustomKeyStoreOutput, error) { req, out := c.ConnectCustomKeyStoreRequest(input) return out, req.Send() } // ConnectCustomKeyStoreWithContext is the same as ConnectCustomKeyStore with the addition of // the ability to pass a context and additional request options. // // See ConnectCustomKeyStore for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ConnectCustomKeyStoreWithContext(ctx aws.Context, input *ConnectCustomKeyStoreInput, opts ...request.Option) (*ConnectCustomKeyStoreOutput, error) { req, out := c.ConnectCustomKeyStoreRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opCreateAlias = "CreateAlias" // CreateAliasRequest generates a "aws/request.Request" representing the // client's request for the CreateAlias operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See CreateAlias for more information on using the CreateAlias // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the CreateAliasRequest method. // req, resp := client.CreateAliasRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, output *CreateAliasOutput) { op := &request.Operation{ Name: opCreateAlias, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &CreateAliasInput{} } output = &CreateAliasOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // CreateAlias API operation for AWS Key Management Service. // // Creates a friendly name for a KMS key. // // Adding, deleting, or updating an alias can allow or deny permission to the // KMS key. For details, see ABAC for KMS (path_to_url // in the Key Management Service Developer Guide. // // You can use an alias to identify a KMS key in the KMS console, in the DescribeKey // operation and in cryptographic operations (path_to_url#cryptographic-operations), // such as Encrypt and GenerateDataKey. You can also change the KMS key that's // associated with the alias (UpdateAlias) or delete the alias (DeleteAlias) // at any time. These operations don't affect the underlying KMS key. // // You can associate the alias with any customer managed key in the same Amazon // Web Services Region. Each alias is associated with only one KMS key at a // time, but a KMS key can have multiple aliases. A valid KMS key is required. // You can't create an alias without a KMS key. // // The alias must be unique in the account and Region, but you can have aliases // with the same name in different Regions. For detailed information about aliases, // see Using aliases (path_to_url // in the Key Management Service Developer Guide. // // This operation does not return a response. To get the alias that you created, // use the ListAliases operation. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on an alias in a // different Amazon Web Services account. // // Required permissions // // - kms:CreateAlias (path_to_url // on the alias (IAM policy). // // - kms:CreateAlias (path_to_url // on the KMS key (key policy). // // For details, see Controlling access to aliases (path_to_url#alias-access) // in the Key Management Service Developer Guide. // // Related operations: // // - DeleteAlias // // - ListAliases // // - UpdateAlias // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation CreateAlias for usage and error information. // // Returned Error Types: // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - AlreadyExistsException // The request was rejected because it attempted to create a resource that already // exists. // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InvalidAliasNameException // The request was rejected because the specified alias name is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - LimitExceededException // The request was rejected because a quota was exceeded. For more information, // see Quotas (path_to_url // in the Key Management Service Developer Guide. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // See also, path_to_url func (c *KMS) CreateAlias(input *CreateAliasInput) (*CreateAliasOutput, error) { req, out := c.CreateAliasRequest(input) return out, req.Send() } // CreateAliasWithContext is the same as CreateAlias with the addition of // the ability to pass a context and additional request options. // // See CreateAlias for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) CreateAliasWithContext(ctx aws.Context, input *CreateAliasInput, opts ...request.Option) (*CreateAliasOutput, error) { req, out := c.CreateAliasRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opCreateCustomKeyStore = "CreateCustomKeyStore" // CreateCustomKeyStoreRequest generates a "aws/request.Request" representing the // client's request for the CreateCustomKeyStore operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See CreateCustomKeyStore for more information on using the CreateCustomKeyStore // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the CreateCustomKeyStoreRequest method. // req, resp := client.CreateCustomKeyStoreRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) CreateCustomKeyStoreRequest(input *CreateCustomKeyStoreInput) (req *request.Request, output *CreateCustomKeyStoreOutput) { op := &request.Operation{ Name: opCreateCustomKeyStore, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &CreateCustomKeyStoreInput{} } output = &CreateCustomKeyStoreOutput{} req = c.newRequest(op, input, output) return } // CreateCustomKeyStore API operation for AWS Key Management Service. // // Creates a custom key store (path_to_url // backed by a key store that you own and manage. When you use a KMS key in // a custom key store for a cryptographic operation, the cryptographic operation // is actually performed in your key store using your keys. KMS supports CloudHSM // key stores (path_to_url // backed by an CloudHSM cluster (path_to_url // and external key stores (path_to_url // backed by an external key store proxy and external key manager outside of // Amazon Web Services. // // This operation is part of the custom key stores (path_to_url // feature in KMS, which combines the convenience and extensive integration // of KMS with the isolation and control of a key store that you own and manage. // // Before you create the custom key store, the required elements must be in // place and operational. We recommend that you use the test tools that KMS // provides to verify the configuration your external key store proxy. For details // about the required elements and verification tests, see Assemble the prerequisites // (for CloudHSM key stores) (path_to_url#before-keystore) // or Assemble the prerequisites (for external key stores) (path_to_url#xks-requirements) // in the Key Management Service Developer Guide. // // To create a custom key store, use the following parameters. // // - To create an CloudHSM key store, specify the CustomKeyStoreName, CloudHsmClusterId, // KeyStorePassword, and TrustAnchorCertificate. The CustomKeyStoreType parameter // is optional for CloudHSM key stores. If you include it, set it to the // default value, AWS_CLOUDHSM. For help with failures, see Troubleshooting // an CloudHSM key store (path_to_url // in the Key Management Service Developer Guide. // // - To create an external key store, specify the CustomKeyStoreName and // a CustomKeyStoreType of EXTERNAL_KEY_STORE. Also, specify values for XksProxyConnectivity, // XksProxyAuthenticationCredential, XksProxyUriEndpoint, and XksProxyUriPath. // If your XksProxyConnectivity value is VPC_ENDPOINT_SERVICE, specify the // XksProxyVpcEndpointServiceName parameter. For help with failures, see // Troubleshooting an external key store (path_to_url // in the Key Management Service Developer Guide. // // For external key stores: // // Some external key managers provide a simpler method for creating an external // key store. For details, see your external key manager documentation. // // When creating an external key store in the KMS console, you can upload a // JSON-based proxy configuration file with the desired values. You cannot use // a proxy configuration with the CreateCustomKeyStore operation. However, you // can use the values in the file to help you determine the correct values for // the CreateCustomKeyStore parameters. // // When the operation completes successfully, it returns the ID of the new custom // key store. Before you can use your new custom key store, you need to use // the ConnectCustomKeyStore operation to connect a new CloudHSM key store to // its CloudHSM cluster, or to connect a new external key store to the external // key store proxy for your external key manager. Even if you are not going // to use your custom key store immediately, you might want to connect it to // verify that all settings are correct and then disconnect it until you are // ready to use it. // // For help with failures, see Troubleshooting a custom key store (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a custom key // store in a different Amazon Web Services account. // // Required permissions: kms:CreateCustomKeyStore (path_to_url // (IAM policy). // // Related operations: // // - ConnectCustomKeyStore // // - DeleteCustomKeyStore // // - DescribeCustomKeyStores // // - DisconnectCustomKeyStore // // - UpdateCustomKeyStore // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation CreateCustomKeyStore for usage and error information. // // Returned Error Types: // // - CloudHsmClusterInUseException // The request was rejected because the specified CloudHSM cluster is already // associated with an CloudHSM key store in the account, or it shares a backup // history with an CloudHSM key store in the account. Each CloudHSM key store // in the account must be associated with a different CloudHSM cluster. // // CloudHSM clusters that share a backup history have the same cluster certificate. // To view the cluster certificate of an CloudHSM cluster, use the DescribeClusters // (path_to_url // operation. // // - CustomKeyStoreNameInUseException // The request was rejected because the specified custom key store name is already // assigned to another custom key store in the account. Try again with a custom // key store name that is unique in the account. // // - CloudHsmClusterNotFoundException // The request was rejected because KMS cannot find the CloudHSM cluster with // the specified cluster ID. Retry the request with a different cluster ID. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - CloudHsmClusterNotActiveException // The request was rejected because the CloudHSM cluster associated with the // CloudHSM key store is not active. Initialize and activate the cluster and // try the command again. For detailed instructions, see Getting Started (path_to_url // in the CloudHSM User Guide. // // - IncorrectTrustAnchorException // The request was rejected because the trust anchor certificate in the request // to create an CloudHSM key store is not the trust anchor certificate for the // specified CloudHSM cluster. // // When you initialize the CloudHSM cluster (path_to_url#sign-csr), // you create the trust anchor certificate and save it in the customerCA.crt // file. // // - CloudHsmClusterInvalidConfigurationException // The request was rejected because the associated CloudHSM cluster did not // meet the configuration requirements for an CloudHSM key store. // // - The CloudHSM cluster must be configured with private subnets in at least // two different Availability Zones in the Region. // // - The security group for the cluster (path_to_url // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound // rules and the Destination in the outbound rules must match the security // group ID. These rules are set by default when you create the CloudHSM // cluster. Do not delete or change them. To get information about a particular // security group, use the DescribeSecurityGroups (path_to_url // operation. // // - The CloudHSM cluster must contain at least as many HSMs as the operation // requires. To add HSMs, use the CloudHSM CreateHsm (path_to_url // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey // operations, the CloudHSM cluster must have at least two active HSMs, each // in a different Availability Zone. For the ConnectCustomKeyStore operation, // the CloudHSM must contain at least one active HSM. // // For information about the requirements for an CloudHSM cluster that is associated // with an CloudHSM key store, see Assemble the Prerequisites (path_to_url#before-keystore) // in the Key Management Service Developer Guide. For information about creating // a private subnet for an CloudHSM cluster, see Create a Private Subnet (path_to_url // in the CloudHSM User Guide. For information about cluster security groups, // see Configure a Default Security Group (path_to_url // in the CloudHSM User Guide . // // - LimitExceededException // The request was rejected because a quota was exceeded. For more information, // see Quotas (path_to_url // in the Key Management Service Developer Guide. // // - XksProxyUriInUseException // The request was rejected because the concatenation of the XksProxyUriEndpoint // and XksProxyUriPath is already associated with another external key store // in this Amazon Web Services Region. Each external key store in a Region must // use a unique external key store proxy API address. // // - XksProxyUriEndpointInUseException // The request was rejected because the XksProxyUriEndpoint is already associated // with another external key store in this Amazon Web Services Region. To identify // the cause, see the error message that accompanies the exception. // // - XksProxyUriUnreachableException // KMS was unable to reach the specified XksProxyUriPath. The path must be reachable // before you create the external key store or update its settings. // // This exception is also thrown when the external key store proxy response // to a GetHealthStatus request indicates that all external key manager instances // are unavailable. // // - XksProxyIncorrectAuthenticationCredentialException // The request was rejected because the proxy credentials failed to authenticate // to the specified external key store proxy. The specified external key store // proxy rejected a status request from KMS due to invalid credentials. This // can indicate an error in the credentials or in the identification of the // external key store proxy. // // - XksProxyVpcEndpointServiceInUseException // The request was rejected because the specified Amazon VPC endpoint service // is already associated with another external key store in this Amazon Web // Services Region. Each external key store in a Region must use a different // Amazon VPC endpoint service. // // - XksProxyVpcEndpointServiceNotFoundException // The request was rejected because KMS could not find the specified VPC endpoint // service. Use DescribeCustomKeyStores to verify the VPC endpoint service name // for the external key store. Also, confirm that the Allow principals list // for the VPC endpoint service includes the KMS service principal for the Region, // such as cks.kms.us-east-1.amazonaws.com. // // - XksProxyVpcEndpointServiceInvalidConfigurationException // The request was rejected because the Amazon VPC endpoint service configuration // does not fulfill the requirements for an external key store. To identify // the cause, see the error message that accompanies the exception and review // the requirements (path_to_url#xks-vpc-requirements) // for Amazon VPC endpoint service connectivity for an external key store. // // - XksProxyInvalidResponseException // KMS cannot interpret the response it received from the external key store // proxy. The problem might be a poorly constructed response, but it could also // be a transient network issue. If you see this error repeatedly, report it // to the proxy vendor. // // - XksProxyInvalidConfigurationException // The request was rejected because the external key store proxy is not configured // correctly. To identify the cause, see the error message that accompanies // the exception. // // See also, path_to_url func (c *KMS) CreateCustomKeyStore(input *CreateCustomKeyStoreInput) (*CreateCustomKeyStoreOutput, error) { req, out := c.CreateCustomKeyStoreRequest(input) return out, req.Send() } // CreateCustomKeyStoreWithContext is the same as CreateCustomKeyStore with the addition of // the ability to pass a context and additional request options. // // See CreateCustomKeyStore for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) CreateCustomKeyStoreWithContext(ctx aws.Context, input *CreateCustomKeyStoreInput, opts ...request.Option) (*CreateCustomKeyStoreOutput, error) { req, out := c.CreateCustomKeyStoreRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opCreateGrant = "CreateGrant" // CreateGrantRequest generates a "aws/request.Request" representing the // client's request for the CreateGrant operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See CreateGrant for more information on using the CreateGrant // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the CreateGrantRequest method. // req, resp := client.CreateGrantRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) CreateGrantRequest(input *CreateGrantInput) (req *request.Request, output *CreateGrantOutput) { op := &request.Operation{ Name: opCreateGrant, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &CreateGrantInput{} } output = &CreateGrantOutput{} req = c.newRequest(op, input, output) return } // CreateGrant API operation for AWS Key Management Service. // // Adds a grant to a KMS key. // // A grant is a policy instrument that allows Amazon Web Services principals // to use KMS keys in cryptographic operations. It also can allow them to view // a KMS key (DescribeKey) and create and manage grants. When authorizing access // to a KMS key, grants are considered along with key policies and IAM policies. // Grants are often used for temporary permissions because you can create one, // use its permissions, and delete it without changing your key policies or // IAM policies. // // For detailed information about grants, including grant terminology, see Grants // in KMS (path_to_url // in the Key Management Service Developer Guide . For examples of working with // grants in several programming languages, see Programming grants (path_to_url // // The CreateGrant operation returns a GrantToken and a GrantId. // // - When you create, retire, or revoke a grant, there might be a brief delay, // usually less than five minutes, until the grant is available throughout // KMS. This state is known as eventual consistency. Once the grant has achieved // eventual consistency, the grantee principal can use the permissions in // the grant without identifying the grant. However, to use the permissions // in the grant immediately, use the GrantToken that CreateGrant returns. // For details, see Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide . // // - The CreateGrant operation also returns a GrantId. You can use the GrantId // and a key identifier to identify the grant in the RetireGrant and RevokeGrant // operations. To find the grant ID, use the ListGrants or ListRetirableGrants // operations. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: Yes. To perform this operation on a KMS key in a different // Amazon Web Services account, specify the key ARN in the value of the KeyId // parameter. // // Required permissions: kms:CreateGrant (path_to_url // (key policy) // // Related operations: // // - ListGrants // // - ListRetirableGrants // // - RetireGrant // // - RevokeGrant // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation CreateGrant for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // // - LimitExceededException // The request was rejected because a quota was exceeded. For more information, // see Quotas (path_to_url // in the Key Management Service Developer Guide. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - DryRunOperationException // The request was rejected because the DryRun parameter was specified. // // See also, path_to_url func (c *KMS) CreateGrant(input *CreateGrantInput) (*CreateGrantOutput, error) { req, out := c.CreateGrantRequest(input) return out, req.Send() } // CreateGrantWithContext is the same as CreateGrant with the addition of // the ability to pass a context and additional request options. // // See CreateGrant for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) CreateGrantWithContext(ctx aws.Context, input *CreateGrantInput, opts ...request.Option) (*CreateGrantOutput, error) { req, out := c.CreateGrantRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opCreateKey = "CreateKey" // CreateKeyRequest generates a "aws/request.Request" representing the // client's request for the CreateKey operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See CreateKey for more information on using the CreateKey // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the CreateKeyRequest method. // req, resp := client.CreateKeyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, output *CreateKeyOutput) { op := &request.Operation{ Name: opCreateKey, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &CreateKeyInput{} } output = &CreateKeyOutput{} req = c.newRequest(op, input, output) return } // CreateKey API operation for AWS Key Management Service. // // Creates a unique customer managed KMS key (path_to_url#kms-keys) // in your Amazon Web Services account and Region. You can use a KMS key in // cryptographic operations, such as encryption and signing. Some Amazon Web // Services services let you use KMS keys that you create and manage to protect // your service resources. // // A KMS key is a logical representation of a cryptographic key. In addition // to the key material used in cryptographic operations, a KMS key includes // metadata, such as the key ID, key policy, creation date, description, and // key state. For details, see Managing keys (path_to_url // in the Key Management Service Developer Guide // // Use the parameters of CreateKey to specify the type of KMS key, the source // of its key material, its key policy, description, tags, and other properties. // // KMS has replaced the term customer master key (CMK) with KMS key and KMS // key. The concept has not changed. To prevent breaking changes, KMS is keeping // some variations of this term. // // To create different types of KMS keys, use the following guidance: // // # Symmetric encryption KMS key // // By default, CreateKey creates a symmetric encryption KMS key with key material // that KMS generates. This is the basic and most widely used type of KMS key, // and provides the best performance. // // To create a symmetric encryption KMS key, you don't need to specify any parameters. // The default value for KeySpec, SYMMETRIC_DEFAULT, the default value for KeyUsage, // ENCRYPT_DECRYPT, and the default value for Origin, AWS_KMS, create a symmetric // encryption KMS key with KMS key material. // // If you need a key for basic encryption and decryption or you are creating // a KMS key to protect your resources in an Amazon Web Services service, create // a symmetric encryption KMS key. The key material in a symmetric encryption // key never leaves KMS unencrypted. You can use a symmetric encryption KMS // key to encrypt and decrypt data up to 4,096 bytes, but they are typically // used to generate data keys and data keys pairs. For details, see GenerateDataKey // and GenerateDataKeyPair. // // # Asymmetric KMS keys // // To create an asymmetric KMS key, use the KeySpec parameter to specify the // type of key material in the KMS key. Then, use the KeyUsage parameter to // determine whether the KMS key will be used to encrypt and decrypt or sign // and verify. You can't change these properties after the KMS key is created. // // Asymmetric KMS keys contain an RSA key pair, Elliptic Curve (ECC) key pair, // or an SM2 key pair (China Regions only). The private key in an asymmetric // KMS key never leaves KMS unencrypted. However, you can use the GetPublicKey // operation to download the public key so it can be used outside of KMS. KMS // keys with RSA or SM2 key pairs can be used to encrypt or decrypt data or // sign and verify messages (but not both). KMS keys with ECC key pairs can // be used only to sign and verify messages. For information about asymmetric // KMS keys, see Asymmetric KMS keys (path_to_url // in the Key Management Service Developer Guide. // // # HMAC KMS key // // To create an HMAC KMS key, set the KeySpec parameter to a key spec value // for HMAC KMS keys. Then set the KeyUsage parameter to GENERATE_VERIFY_MAC. // You must set the key usage even though GENERATE_VERIFY_MAC is the only valid // key usage value for HMAC KMS keys. You can't change these properties after // the KMS key is created. // // HMAC KMS keys are symmetric keys that never leave KMS unencrypted. You can // use HMAC keys to generate (GenerateMac) and verify (VerifyMac) HMAC codes // for messages up to 4096 bytes. // // # Multi-Region primary keys // // # Imported key material // // To create a multi-Region primary key in the local Amazon Web Services Region, // use the MultiRegion parameter with a value of True. To create a multi-Region // replica key, that is, a KMS key with the same key ID and key material as // a primary key, but in a different Amazon Web Services Region, use the ReplicateKey // operation. To change a replica key to a primary key, and its primary key // to a replica key, use the UpdatePrimaryRegion operation. // // You can create multi-Region KMS keys for all supported KMS key types: symmetric // encryption KMS keys, HMAC KMS keys, asymmetric encryption KMS keys, and asymmetric // signing KMS keys. You can also create multi-Region keys with imported key // material. However, you can't create multi-Region keys in a custom key store. // // This operation supports multi-Region keys, an KMS feature that lets you create // multiple interoperable KMS keys in different Amazon Web Services Regions. // Because these KMS keys have the same key ID, key material, and other metadata, // you can use them interchangeably to encrypt data in one Amazon Web Services // Region and decrypt it in a different Amazon Web Services Region without re-encrypting // the data or making a cross-Region call. For more information about multi-Region // keys, see Multi-Region keys in KMS (path_to_url // in the Key Management Service Developer Guide. // // To import your own key material into a KMS key, begin by creating a KMS key // with no key material. To do this, use the Origin parameter of CreateKey with // a value of EXTERNAL. Next, use GetParametersForImport operation to get a // public key and import token. Use the wrapping public key to encrypt your // key material. Then, use ImportKeyMaterial with your import token to import // the key material. For step-by-step instructions, see Importing Key Material // (path_to_url // in the Key Management Service Developer Guide . // // You can import key material into KMS keys of all supported KMS key types: // symmetric encryption KMS keys, HMAC KMS keys, asymmetric encryption KMS keys, // and asymmetric signing KMS keys. You can also create multi-Region keys with // imported key material. However, you can't import key material into a KMS // key in a custom key store. // // To create a multi-Region primary key with imported key material, use the // Origin parameter of CreateKey with a value of EXTERNAL and the MultiRegion // parameter with a value of True. To create replicas of the multi-Region primary // key, use the ReplicateKey operation. For instructions, see Importing key // material into multi-Region keys (path_to_url // For more information about multi-Region keys, see Multi-Region keys in KMS // (path_to_url // in the Key Management Service Developer Guide. // // # Custom key store // // A custom key store (path_to_url // lets you protect your Amazon Web Services resources using keys in a backing // key store that you own and manage. When you request a cryptographic operation // with a KMS key in a custom key store, the operation is performed in the backing // key store using its cryptographic keys. // // KMS supports CloudHSM key stores (path_to_url // backed by an CloudHSM cluster and external key stores (path_to_url // backed by an external key manager outside of Amazon Web Services. When you // create a KMS key in an CloudHSM key store, KMS generates an encryption key // in the CloudHSM cluster and associates it with the KMS key. When you create // a KMS key in an external key store, you specify an existing encryption key // in the external key manager. // // Some external key managers provide a simpler method for creating a KMS key // in an external key store. For details, see your external key manager documentation. // // Before you create a KMS key in a custom key store, the ConnectionState of // the key store must be CONNECTED. To connect the custom key store, use the // ConnectCustomKeyStore operation. To find the ConnectionState, use the DescribeCustomKeyStores // operation. // // To create a KMS key in a custom key store, use the CustomKeyStoreId. Use // the default KeySpec value, SYMMETRIC_DEFAULT, and the default KeyUsage value, // ENCRYPT_DECRYPT to create a symmetric encryption key. No other key type is // supported in a custom key store. // // To create a KMS key in an CloudHSM key store (path_to_url // use the Origin parameter with a value of AWS_CLOUDHSM. The CloudHSM cluster // that is associated with the custom key store must have at least two active // HSMs in different Availability Zones in the Amazon Web Services Region. // // To create a KMS key in an external key store (path_to_url // use the Origin parameter with a value of EXTERNAL_KEY_STORE and an XksKeyId // parameter that identifies an existing external key. // // Some external key managers provide a simpler method for creating a KMS key // in an external key store. For details, see your external key manager documentation. // // Cross-account use: No. You cannot use this operation to create a KMS key // in a different Amazon Web Services account. // // Required permissions: kms:CreateKey (path_to_url // (IAM policy). To use the Tags parameter, kms:TagResource (path_to_url // (IAM policy). For examples and information about related permissions, see // Allow a user to create KMS keys (path_to_url#iam-policy-example-create-key) // in the Key Management Service Developer Guide. // // Related operations: // // - DescribeKey // // - ListKeys // // - ScheduleKeyDeletion // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation CreateKey for usage and error information. // // Returned Error Types: // // - MalformedPolicyDocumentException // The request was rejected because the specified policy is not syntactically // or semantically correct. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - LimitExceededException // The request was rejected because a quota was exceeded. For more information, // see Quotas (path_to_url // in the Key Management Service Developer Guide. // // - TagException // The request was rejected because one or more tags are not valid. // // - CustomKeyStoreNotFoundException // The request was rejected because KMS cannot find a custom key store with // the specified key store name or ID. // // - CustomKeyStoreInvalidStateException // The request was rejected because of the ConnectionState of the custom key // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores // operation. // // This exception is thrown under the following conditions: // // - You requested the ConnectCustomKeyStore operation on a custom key store // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid // for all other ConnectionState values. To reconnect a custom key store // in a FAILED state, disconnect it (DisconnectCustomKeyStore), then connect // it (ConnectCustomKeyStore). // // - You requested the CreateKey operation in a custom key store that is // not connected. This operations is valid only when the custom key store // ConnectionState is CONNECTED. // // - You requested the DisconnectCustomKeyStore operation on a custom key // store with a ConnectionState of DISCONNECTING or DISCONNECTED. This operation // is valid for all other ConnectionState values. // // - You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation // on a custom key store that is not disconnected. This operation is valid // only when the custom key store ConnectionState is DISCONNECTED. // // - You requested the GenerateRandom operation in an CloudHSM key store // that is not connected. This operation is valid only when the CloudHSM // key store ConnectionState is CONNECTED. // // - CloudHsmClusterInvalidConfigurationException // The request was rejected because the associated CloudHSM cluster did not // meet the configuration requirements for an CloudHSM key store. // // - The CloudHSM cluster must be configured with private subnets in at least // two different Availability Zones in the Region. // // - The security group for the cluster (path_to_url // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound // rules and the Destination in the outbound rules must match the security // group ID. These rules are set by default when you create the CloudHSM // cluster. Do not delete or change them. To get information about a particular // security group, use the DescribeSecurityGroups (path_to_url // operation. // // - The CloudHSM cluster must contain at least as many HSMs as the operation // requires. To add HSMs, use the CloudHSM CreateHsm (path_to_url // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey // operations, the CloudHSM cluster must have at least two active HSMs, each // in a different Availability Zone. For the ConnectCustomKeyStore operation, // the CloudHSM must contain at least one active HSM. // // For information about the requirements for an CloudHSM cluster that is associated // with an CloudHSM key store, see Assemble the Prerequisites (path_to_url#before-keystore) // in the Key Management Service Developer Guide. For information about creating // a private subnet for an CloudHSM cluster, see Create a Private Subnet (path_to_url // in the CloudHSM User Guide. For information about cluster security groups, // see Configure a Default Security Group (path_to_url // in the CloudHSM User Guide . // // - XksKeyInvalidConfigurationException // The request was rejected because the external key specified by the XksKeyId // parameter did not meet the configuration requirements for an external key // store. // // The external key must be an AES-256 symmetric key that is enabled and performs // encryption and decryption. // // - XksKeyAlreadyInUseException // The request was rejected because the (XksKeyId) is already associated with // another KMS key in this external key store. Each KMS key in an external key // store must be associated with a different external key. // // - XksKeyNotFoundException // The request was rejected because the external key store proxy could not find // the external key. This exception is thrown when the value of the XksKeyId // parameter doesn't identify a key in the external key manager associated with // the external key proxy. // // Verify that the XksKeyId represents an existing key in the external key manager. // Use the key identifier that the external key store proxy uses to identify // the key. For details, see the documentation provided with your external key // store proxy or key manager. // // See also, path_to_url func (c *KMS) CreateKey(input *CreateKeyInput) (*CreateKeyOutput, error) { req, out := c.CreateKeyRequest(input) return out, req.Send() } // CreateKeyWithContext is the same as CreateKey with the addition of // the ability to pass a context and additional request options. // // See CreateKey for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) CreateKeyWithContext(ctx aws.Context, input *CreateKeyInput, opts ...request.Option) (*CreateKeyOutput, error) { req, out := c.CreateKeyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opDecrypt = "Decrypt" // DecryptRequest generates a "aws/request.Request" representing the // client's request for the Decrypt operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See Decrypt for more information on using the Decrypt // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the DecryptRequest method. // req, resp := client.DecryptRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) DecryptRequest(input *DecryptInput) (req *request.Request, output *DecryptOutput) { op := &request.Operation{ Name: opDecrypt, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &DecryptInput{} } output = &DecryptOutput{} req = c.newRequest(op, input, output) return } // Decrypt API operation for AWS Key Management Service. // // Decrypts ciphertext that was encrypted by a KMS key using any of the following // operations: // // - Encrypt // // - GenerateDataKey // // - GenerateDataKeyPair // // - GenerateDataKeyWithoutPlaintext // // - GenerateDataKeyPairWithoutPlaintext // // You can use this operation to decrypt ciphertext that was encrypted under // a symmetric encryption KMS key or an asymmetric encryption KMS key. When // the KMS key is asymmetric, you must specify the KMS key and the encryption // algorithm that was used to encrypt the ciphertext. For information about // asymmetric KMS keys, see Asymmetric KMS keys (path_to_url // in the Key Management Service Developer Guide. // // The Decrypt operation also decrypts ciphertext that was encrypted outside // of KMS by the public key in an KMS asymmetric KMS key. However, it cannot // decrypt symmetric ciphertext produced by other libraries, such as the Amazon // Web Services Encryption SDK (path_to_url // or Amazon S3 client-side encryption (path_to_url // These libraries return a ciphertext format that is incompatible with KMS. // // If the ciphertext was encrypted under a symmetric encryption KMS key, the // KeyId parameter is optional. KMS can get this information from metadata that // it adds to the symmetric ciphertext blob. This feature adds durability to // your implementation by ensuring that authorized users can decrypt ciphertext // decades after it was encrypted, even if they've lost track of the key ID. // However, specifying the KMS key is always recommended as a best practice. // When you use the KeyId parameter to specify a KMS key, KMS only uses the // KMS key you specify. If the ciphertext was encrypted under a different KMS // key, the Decrypt operation fails. This practice ensures that you use the // KMS key that you intend. // // Whenever possible, use key policies to give users permission to call the // Decrypt operation on a particular KMS key, instead of using &IAM; policies. // Otherwise, you might create an &IAM; policy that gives the user Decrypt permission // on all KMS keys. This user could decrypt ciphertext that was encrypted by // KMS keys in other accounts if the key policy for the cross-account KMS key // permits it. If you must use an IAM policy for Decrypt permissions, limit // the user to particular KMS keys or particular trusted accounts. For details, // see Best practices for IAM policies (path_to_url#iam-policies-best-practices) // in the Key Management Service Developer Guide. // // Decrypt also supports Amazon Web Services Nitro Enclaves (path_to_url // which provide an isolated compute environment in Amazon EC2. To call Decrypt // for a Nitro enclave, use the Amazon Web Services Nitro Enclaves SDK (path_to_url#sdk) // or any Amazon Web Services SDK. Use the Recipient parameter to provide the // attestation document for the enclave. Instead of the plaintext data, the // response includes the plaintext data encrypted with the public key from the // attestation document (CiphertextForRecipient). For information about the // interaction between KMS and Amazon Web Services Nitro Enclaves, see How Amazon // Web Services Nitro Enclaves uses KMS (path_to_url // in the Key Management Service Developer Guide. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: Yes. If you use the KeyId parameter to identify a KMS // key in a different Amazon Web Services account, specify the key ARN or the // alias ARN of the KMS key. // // Required permissions: kms:Decrypt (path_to_url // (key policy) // // Related operations: // // - Encrypt // // - GenerateDataKey // // - GenerateDataKeyPair // // - ReEncrypt // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation Decrypt for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - InvalidCiphertextException // From the Decrypt or ReEncrypt operation, the request was rejected because // the specified ciphertext, or additional authenticated data incorporated into // the ciphertext, such as the encryption context, is corrupted, missing, or // otherwise invalid. // // From the ImportKeyMaterial operation, the request was rejected because KMS // could not decrypt the encrypted (wrapped) key material. // // - KeyUnavailableException // The request was rejected because the specified KMS key was not available. // You can retry the request. // // - IncorrectKeyException // The request was rejected because the specified KMS key cannot decrypt the // data. The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request // must identify the same KMS key that was used to encrypt the ciphertext. // // - InvalidKeyUsageException // The request was rejected for one of the following reasons: // // - The KeyUsage value of the KMS key is incompatible with the API operation. // // - The encryption algorithm or signing algorithm specified for the operation // is incompatible with the type of key material in the KMS key (KeySpec). // // For encrypting, decrypting, re-encrypting, and generating data keys, the // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying messages, the // KeyUsage must be SIGN_VERIFY. For generating and verifying message authentication // codes (MACs), the KeyUsage must be GENERATE_VERIFY_MAC. To find the KeyUsage // of a KMS key, use the DescribeKey operation. // // To find the encryption or signing algorithms supported for a particular KMS // key, use the DescribeKey operation. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - DryRunOperationException // The request was rejected because the DryRun parameter was specified. // // See also, path_to_url func (c *KMS) Decrypt(input *DecryptInput) (*DecryptOutput, error) { req, out := c.DecryptRequest(input) return out, req.Send() } // DecryptWithContext is the same as Decrypt with the addition of // the ability to pass a context and additional request options. // // See Decrypt for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) DecryptWithContext(ctx aws.Context, input *DecryptInput, opts ...request.Option) (*DecryptOutput, error) { req, out := c.DecryptRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opDeleteAlias = "DeleteAlias" // DeleteAliasRequest generates a "aws/request.Request" representing the // client's request for the DeleteAlias operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See DeleteAlias for more information on using the DeleteAlias // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the DeleteAliasRequest method. // req, resp := client.DeleteAliasRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, output *DeleteAliasOutput) { op := &request.Operation{ Name: opDeleteAlias, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &DeleteAliasInput{} } output = &DeleteAliasOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // DeleteAlias API operation for AWS Key Management Service. // // Deletes the specified alias. // // Adding, deleting, or updating an alias can allow or deny permission to the // KMS key. For details, see ABAC for KMS (path_to_url // in the Key Management Service Developer Guide. // // Because an alias is not a property of a KMS key, you can delete and change // the aliases of a KMS key without affecting the KMS key. Also, aliases do // not appear in the response from the DescribeKey operation. To get the aliases // of all KMS keys, use the ListAliases operation. // // Each KMS key can have multiple aliases. To change the alias of a KMS key, // use DeleteAlias to delete the current alias and CreateAlias to create a new // alias. To associate an existing alias with a different KMS key, call UpdateAlias. // // Cross-account use: No. You cannot perform this operation on an alias in a // different Amazon Web Services account. // // Required permissions // // - kms:DeleteAlias (path_to_url // on the alias (IAM policy). // // - kms:DeleteAlias (path_to_url // on the KMS key (key policy). // // For details, see Controlling access to aliases (path_to_url#alias-access) // in the Key Management Service Developer Guide. // // Related operations: // // - CreateAlias // // - ListAliases // // - UpdateAlias // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation DeleteAlias for usage and error information. // // Returned Error Types: // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // See also, path_to_url func (c *KMS) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error) { req, out := c.DeleteAliasRequest(input) return out, req.Send() } // DeleteAliasWithContext is the same as DeleteAlias with the addition of // the ability to pass a context and additional request options. // // See DeleteAlias for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) DeleteAliasWithContext(ctx aws.Context, input *DeleteAliasInput, opts ...request.Option) (*DeleteAliasOutput, error) { req, out := c.DeleteAliasRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opDeleteCustomKeyStore = "DeleteCustomKeyStore" // DeleteCustomKeyStoreRequest generates a "aws/request.Request" representing the // client's request for the DeleteCustomKeyStore operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See DeleteCustomKeyStore for more information on using the DeleteCustomKeyStore // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the DeleteCustomKeyStoreRequest method. // req, resp := client.DeleteCustomKeyStoreRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) DeleteCustomKeyStoreRequest(input *DeleteCustomKeyStoreInput) (req *request.Request, output *DeleteCustomKeyStoreOutput) { op := &request.Operation{ Name: opDeleteCustomKeyStore, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &DeleteCustomKeyStoreInput{} } output = &DeleteCustomKeyStoreOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // DeleteCustomKeyStore API operation for AWS Key Management Service. // // Deletes a custom key store (path_to_url // This operation does not affect any backing elements of the custom key store. // It does not delete the CloudHSM cluster that is associated with an CloudHSM // key store, or affect any users or keys in the cluster. For an external key // store, it does not affect the external key store proxy, external key manager, // or any external keys. // // This operation is part of the custom key stores (path_to_url // feature in KMS, which combines the convenience and extensive integration // of KMS with the isolation and control of a key store that you own and manage. // // The custom key store that you delete cannot contain any KMS keys (path_to_url#kms_keys). // Before deleting the key store, verify that you will never need to use any // of the KMS keys in the key store for any cryptographic operations (path_to_url#cryptographic-operations). // Then, use ScheduleKeyDeletion to delete the KMS keys from the key store. // After the required waiting period expires and all KMS keys are deleted from // the custom key store, use DisconnectCustomKeyStore to disconnect the key // store from KMS. Then, you can delete the custom key store. // // For keys in an CloudHSM key store, the ScheduleKeyDeletion operation makes // a best effort to delete the key material from the associated cluster. However, // you might need to manually delete the orphaned key material (path_to_url#fix-keystore-orphaned-key) // from the cluster and its backups. KMS never creates, manages, or deletes // cryptographic keys in the external key manager associated with an external // key store. You must manage them using your external key manager tools. // // Instead of deleting the custom key store, consider using the DisconnectCustomKeyStore // operation to disconnect the custom key store from its backing key store. // While the key store is disconnected, you cannot create or use the KMS keys // in the key store. But, you do not need to delete KMS keys and you can reconnect // a disconnected custom key store at any time. // // If the operation succeeds, it returns a JSON object with no properties. // // Cross-account use: No. You cannot perform this operation on a custom key // store in a different Amazon Web Services account. // // Required permissions: kms:DeleteCustomKeyStore (path_to_url // (IAM policy) // // Related operations: // // - ConnectCustomKeyStore // // - CreateCustomKeyStore // // - DescribeCustomKeyStores // // - DisconnectCustomKeyStore // // - UpdateCustomKeyStore // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation DeleteCustomKeyStore for usage and error information. // // Returned Error Types: // // - CustomKeyStoreHasCMKsException // The request was rejected because the custom key store contains KMS keys. // After verifying that you do not need to use the KMS keys, use the ScheduleKeyDeletion // operation to delete the KMS keys. After they are deleted, you can delete // the custom key store. // // - CustomKeyStoreInvalidStateException // The request was rejected because of the ConnectionState of the custom key // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores // operation. // // This exception is thrown under the following conditions: // // - You requested the ConnectCustomKeyStore operation on a custom key store // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid // for all other ConnectionState values. To reconnect a custom key store // in a FAILED state, disconnect it (DisconnectCustomKeyStore), then connect // it (ConnectCustomKeyStore). // // - You requested the CreateKey operation in a custom key store that is // not connected. This operations is valid only when the custom key store // ConnectionState is CONNECTED. // // - You requested the DisconnectCustomKeyStore operation on a custom key // store with a ConnectionState of DISCONNECTING or DISCONNECTED. This operation // is valid for all other ConnectionState values. // // - You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation // on a custom key store that is not disconnected. This operation is valid // only when the custom key store ConnectionState is DISCONNECTED. // // - You requested the GenerateRandom operation in an CloudHSM key store // that is not connected. This operation is valid only when the CloudHSM // key store ConnectionState is CONNECTED. // // - CustomKeyStoreNotFoundException // The request was rejected because KMS cannot find a custom key store with // the specified key store name or ID. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // See also, path_to_url func (c *KMS) DeleteCustomKeyStore(input *DeleteCustomKeyStoreInput) (*DeleteCustomKeyStoreOutput, error) { req, out := c.DeleteCustomKeyStoreRequest(input) return out, req.Send() } // DeleteCustomKeyStoreWithContext is the same as DeleteCustomKeyStore with the addition of // the ability to pass a context and additional request options. // // See DeleteCustomKeyStore for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) DeleteCustomKeyStoreWithContext(ctx aws.Context, input *DeleteCustomKeyStoreInput, opts ...request.Option) (*DeleteCustomKeyStoreOutput, error) { req, out := c.DeleteCustomKeyStoreRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opDeleteImportedKeyMaterial = "DeleteImportedKeyMaterial" // DeleteImportedKeyMaterialRequest generates a "aws/request.Request" representing the // client's request for the DeleteImportedKeyMaterial operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See DeleteImportedKeyMaterial for more information on using the DeleteImportedKeyMaterial // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the DeleteImportedKeyMaterialRequest method. // req, resp := client.DeleteImportedKeyMaterialRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) DeleteImportedKeyMaterialRequest(input *DeleteImportedKeyMaterialInput) (req *request.Request, output *DeleteImportedKeyMaterialOutput) { op := &request.Operation{ Name: opDeleteImportedKeyMaterial, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &DeleteImportedKeyMaterialInput{} } output = &DeleteImportedKeyMaterialOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // DeleteImportedKeyMaterial API operation for AWS Key Management Service. // // Deletes key material that was previously imported. This operation makes the // specified KMS key temporarily unusable. To restore the usability of the KMS // key, reimport the same key material. For more information about importing // key material into KMS, see Importing Key Material (path_to_url // in the Key Management Service Developer Guide. // // When the specified KMS key is in the PendingDeletion state, this operation // does not change the KMS key's state. Otherwise, it changes the KMS key's // state to PendingImport. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:DeleteImportedKeyMaterial (path_to_url // (key policy) // // Related operations: // // - GetParametersForImport // // - ImportKeyMaterial // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation DeleteImportedKeyMaterial for usage and error information. // // Returned Error Types: // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // See also, path_to_url func (c *KMS) DeleteImportedKeyMaterial(input *DeleteImportedKeyMaterialInput) (*DeleteImportedKeyMaterialOutput, error) { req, out := c.DeleteImportedKeyMaterialRequest(input) return out, req.Send() } // DeleteImportedKeyMaterialWithContext is the same as DeleteImportedKeyMaterial with the addition of // the ability to pass a context and additional request options. // // See DeleteImportedKeyMaterial for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) DeleteImportedKeyMaterialWithContext(ctx aws.Context, input *DeleteImportedKeyMaterialInput, opts ...request.Option) (*DeleteImportedKeyMaterialOutput, error) { req, out := c.DeleteImportedKeyMaterialRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opDescribeCustomKeyStores = "DescribeCustomKeyStores" // DescribeCustomKeyStoresRequest generates a "aws/request.Request" representing the // client's request for the DescribeCustomKeyStores operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See DescribeCustomKeyStores for more information on using the DescribeCustomKeyStores // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the DescribeCustomKeyStoresRequest method. // req, resp := client.DescribeCustomKeyStoresRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) DescribeCustomKeyStoresRequest(input *DescribeCustomKeyStoresInput) (req *request.Request, output *DescribeCustomKeyStoresOutput) { op := &request.Operation{ Name: opDescribeCustomKeyStores, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"NextMarker"}, LimitToken: "Limit", TruncationToken: "", }, } if input == nil { input = &DescribeCustomKeyStoresInput{} } output = &DescribeCustomKeyStoresOutput{} req = c.newRequest(op, input, output) return } // DescribeCustomKeyStores API operation for AWS Key Management Service. // // Gets information about custom key stores (path_to_url // in the account and Region. // // This operation is part of the custom key stores (path_to_url // feature in KMS, which combines the convenience and extensive integration // of KMS with the isolation and control of a key store that you own and manage. // // By default, this operation returns information about all custom key stores // in the account and Region. To get only information about a particular custom // key store, use either the CustomKeyStoreName or CustomKeyStoreId parameter // (but not both). // // To determine whether the custom key store is connected to its CloudHSM cluster // or external key store proxy, use the ConnectionState element in the response. // If an attempt to connect the custom key store failed, the ConnectionState // value is FAILED and the ConnectionErrorCode element in the response indicates // the cause of the failure. For help interpreting the ConnectionErrorCode, // see CustomKeyStoresListEntry. // // Custom key stores have a DISCONNECTED connection state if the key store has // never been connected or you used the DisconnectCustomKeyStore operation to // disconnect it. Otherwise, the connection state is CONNECTED. If your custom // key store connection state is CONNECTED but you are having trouble using // it, verify that the backing store is active and available. For an CloudHSM // key store, verify that the associated CloudHSM cluster is active and contains // the minimum number of HSMs required for the operation, if any. For an external // key store, verify that the external key store proxy and its associated external // key manager are reachable and enabled. // // For help repairing your CloudHSM key store, see the Troubleshooting CloudHSM // key stores (path_to_url // For help repairing your external key store, see the Troubleshooting external // key stores (path_to_url // Both topics are in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a custom key // store in a different Amazon Web Services account. // // Required permissions: kms:DescribeCustomKeyStores (path_to_url // (IAM policy) // // Related operations: // // - ConnectCustomKeyStore // // - CreateCustomKeyStore // // - DeleteCustomKeyStore // // - DisconnectCustomKeyStore // // - UpdateCustomKeyStore // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation DescribeCustomKeyStores for usage and error information. // // Returned Error Types: // // - CustomKeyStoreNotFoundException // The request was rejected because KMS cannot find a custom key store with // the specified key store name or ID. // // - InvalidMarkerException // The request was rejected because the marker that specifies where pagination // should next begin is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // See also, path_to_url func (c *KMS) DescribeCustomKeyStores(input *DescribeCustomKeyStoresInput) (*DescribeCustomKeyStoresOutput, error) { req, out := c.DescribeCustomKeyStoresRequest(input) return out, req.Send() } // DescribeCustomKeyStoresWithContext is the same as DescribeCustomKeyStores with the addition of // the ability to pass a context and additional request options. // // See DescribeCustomKeyStores for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) DescribeCustomKeyStoresWithContext(ctx aws.Context, input *DescribeCustomKeyStoresInput, opts ...request.Option) (*DescribeCustomKeyStoresOutput, error) { req, out := c.DescribeCustomKeyStoresRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } // DescribeCustomKeyStoresPages iterates over the pages of a DescribeCustomKeyStores operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // // See DescribeCustomKeyStores method for more information on how to use this operation. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a DescribeCustomKeyStores operation. // pageNum := 0 // err := client.DescribeCustomKeyStoresPages(params, // func(page *kms.DescribeCustomKeyStoresOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) func (c *KMS) DescribeCustomKeyStoresPages(input *DescribeCustomKeyStoresInput, fn func(*DescribeCustomKeyStoresOutput, bool) bool) error { return c.DescribeCustomKeyStoresPagesWithContext(aws.BackgroundContext(), input, fn) } // DescribeCustomKeyStoresPagesWithContext same as DescribeCustomKeyStoresPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) DescribeCustomKeyStoresPagesWithContext(ctx aws.Context, input *DescribeCustomKeyStoresInput, fn func(*DescribeCustomKeyStoresOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { var inCpy *DescribeCustomKeyStoresInput if input != nil { tmp := *input inCpy = &tmp } req, _ := c.DescribeCustomKeyStoresRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } for p.Next() { if !fn(p.Page().(*DescribeCustomKeyStoresOutput), !p.HasNextPage()) { break } } return p.Err() } const opDescribeKey = "DescribeKey" // DescribeKeyRequest generates a "aws/request.Request" representing the // client's request for the DescribeKey operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See DescribeKey for more information on using the DescribeKey // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the DescribeKeyRequest method. // req, resp := client.DescribeKeyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) DescribeKeyRequest(input *DescribeKeyInput) (req *request.Request, output *DescribeKeyOutput) { op := &request.Operation{ Name: opDescribeKey, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &DescribeKeyInput{} } output = &DescribeKeyOutput{} req = c.newRequest(op, input, output) return } // DescribeKey API operation for AWS Key Management Service. // // Provides detailed information about a KMS key. You can run DescribeKey on // a customer managed key (path_to_url#customer-cmk) // or an Amazon Web Services managed key (path_to_url#aws-managed-cmk). // // This detailed information includes the key ARN, creation date (and deletion // date, if applicable), the key state, and the origin and expiration date (if // any) of the key material. It includes fields, like KeySpec, that help you // distinguish different types of KMS keys. It also displays the key usage (encryption, // signing, or generating and verifying MACs) and the algorithms that the KMS // key supports. // // For multi-Region keys (path_to_url // DescribeKey displays the primary key and all related replica keys. For KMS // keys in CloudHSM key stores (path_to_url // it includes information about the key store, such as the key store ID and // the CloudHSM cluster ID. For KMS keys in external key stores (path_to_url // it includes the custom key store ID and the ID of the external key. // // DescribeKey does not return the following information: // // - Aliases associated with the KMS key. To get this information, use ListAliases. // // - Whether automatic key rotation is enabled on the KMS key. To get this // information, use GetKeyRotationStatus. Also, some key states prevent a // KMS key from being automatically rotated. For details, see How Automatic // Key Rotation Works (path_to_url#rotate-keys-how-it-works) // in the Key Management Service Developer Guide. // // - Tags on the KMS key. To get this information, use ListResourceTags. // // - Key policies and grants on the KMS key. To get this information, use // GetKeyPolicy and ListGrants. // // In general, DescribeKey is a non-mutating operation. It returns data about // KMS keys, but doesn't change them. However, Amazon Web Services services // use DescribeKey to create Amazon Web Services managed keys (path_to_url#aws-managed-cmk) // from a predefined Amazon Web Services alias with no key ID. // // Cross-account use: Yes. To perform this operation with a KMS key in a different // Amazon Web Services account, specify the key ARN or alias ARN in the value // of the KeyId parameter. // // Required permissions: kms:DescribeKey (path_to_url // (key policy) // // Related operations: // // - GetKeyPolicy // // - GetKeyRotationStatus // // - ListAliases // // - ListGrants // // - ListKeys // // - ListResourceTags // // - ListRetirableGrants // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation DescribeKey for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // See also, path_to_url func (c *KMS) DescribeKey(input *DescribeKeyInput) (*DescribeKeyOutput, error) { req, out := c.DescribeKeyRequest(input) return out, req.Send() } // DescribeKeyWithContext is the same as DescribeKey with the addition of // the ability to pass a context and additional request options. // // See DescribeKey for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) DescribeKeyWithContext(ctx aws.Context, input *DescribeKeyInput, opts ...request.Option) (*DescribeKeyOutput, error) { req, out := c.DescribeKeyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opDisableKey = "DisableKey" // DisableKeyRequest generates a "aws/request.Request" representing the // client's request for the DisableKey operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See DisableKey for more information on using the DisableKey // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the DisableKeyRequest method. // req, resp := client.DisableKeyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) DisableKeyRequest(input *DisableKeyInput) (req *request.Request, output *DisableKeyOutput) { op := &request.Operation{ Name: opDisableKey, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &DisableKeyInput{} } output = &DisableKeyOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // DisableKey API operation for AWS Key Management Service. // // Sets the state of a KMS key to disabled. This change temporarily prevents // use of the KMS key for cryptographic operations (path_to_url#cryptographic-operations). // // For more information about how key state affects the use of a KMS key, see // Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:DisableKey (path_to_url // (key policy) // // Related operations: EnableKey // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation DisableKey for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // See also, path_to_url func (c *KMS) DisableKey(input *DisableKeyInput) (*DisableKeyOutput, error) { req, out := c.DisableKeyRequest(input) return out, req.Send() } // DisableKeyWithContext is the same as DisableKey with the addition of // the ability to pass a context and additional request options. // // See DisableKey for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) DisableKeyWithContext(ctx aws.Context, input *DisableKeyInput, opts ...request.Option) (*DisableKeyOutput, error) { req, out := c.DisableKeyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opDisableKeyRotation = "DisableKeyRotation" // DisableKeyRotationRequest generates a "aws/request.Request" representing the // client's request for the DisableKeyRotation operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See DisableKeyRotation for more information on using the DisableKeyRotation // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the DisableKeyRotationRequest method. // req, resp := client.DisableKeyRotationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) DisableKeyRotationRequest(input *DisableKeyRotationInput) (req *request.Request, output *DisableKeyRotationOutput) { op := &request.Operation{ Name: opDisableKeyRotation, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &DisableKeyRotationInput{} } output = &DisableKeyRotationOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // DisableKeyRotation API operation for AWS Key Management Service. // // Disables automatic rotation of the key material (path_to_url // of the specified symmetric encryption KMS key. // // Automatic key rotation is supported only on symmetric encryption KMS keys. // You cannot enable automatic rotation of asymmetric KMS keys (path_to_url // HMAC KMS keys (path_to_url // KMS keys with imported key material (path_to_url // or KMS keys in a custom key store (path_to_url // To enable or disable automatic rotation of a set of related multi-Region // keys (path_to_url#multi-region-rotate), // set the property on the primary key. // // You can enable (EnableKeyRotation) and disable automatic rotation of the // key material in customer managed KMS keys (path_to_url#customer-cmk). // Key material rotation of Amazon Web Services managed KMS keys (path_to_url#aws-managed-cmk) // is not configurable. KMS always rotates the key material for every year. // Rotation of Amazon Web Services owned KMS keys (path_to_url#aws-owned-cmk) // varies. // // In May 2022, KMS changed the rotation schedule for Amazon Web Services managed // keys from every three years to every year. For details, see EnableKeyRotation. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:DisableKeyRotation (path_to_url // (key policy) // // Related operations: // // - EnableKeyRotation // // - GetKeyRotationStatus // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation DisableKeyRotation for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // // See also, path_to_url func (c *KMS) DisableKeyRotation(input *DisableKeyRotationInput) (*DisableKeyRotationOutput, error) { req, out := c.DisableKeyRotationRequest(input) return out, req.Send() } // DisableKeyRotationWithContext is the same as DisableKeyRotation with the addition of // the ability to pass a context and additional request options. // // See DisableKeyRotation for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) DisableKeyRotationWithContext(ctx aws.Context, input *DisableKeyRotationInput, opts ...request.Option) (*DisableKeyRotationOutput, error) { req, out := c.DisableKeyRotationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opDisconnectCustomKeyStore = "DisconnectCustomKeyStore" // DisconnectCustomKeyStoreRequest generates a "aws/request.Request" representing the // client's request for the DisconnectCustomKeyStore operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See DisconnectCustomKeyStore for more information on using the DisconnectCustomKeyStore // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the DisconnectCustomKeyStoreRequest method. // req, resp := client.DisconnectCustomKeyStoreRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) DisconnectCustomKeyStoreRequest(input *DisconnectCustomKeyStoreInput) (req *request.Request, output *DisconnectCustomKeyStoreOutput) { op := &request.Operation{ Name: opDisconnectCustomKeyStore, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &DisconnectCustomKeyStoreInput{} } output = &DisconnectCustomKeyStoreOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // DisconnectCustomKeyStore API operation for AWS Key Management Service. // // Disconnects the custom key store (path_to_url // from its backing key store. This operation disconnects an CloudHSM key store // from its associated CloudHSM cluster or disconnects an external key store // from the external key store proxy that communicates with your external key // manager. // // This operation is part of the custom key stores (path_to_url // feature in KMS, which combines the convenience and extensive integration // of KMS with the isolation and control of a key store that you own and manage. // // While a custom key store is disconnected, you can manage the custom key store // and its KMS keys, but you cannot create or use its KMS keys. You can reconnect // the custom key store at any time. // // While a custom key store is disconnected, all attempts to create KMS keys // in the custom key store or to use existing KMS keys in cryptographic operations // (path_to_url#cryptographic-operations) // will fail. This action can prevent users from storing and accessing sensitive // data. // // When you disconnect a custom key store, its ConnectionState changes to Disconnected. // To find the connection state of a custom key store, use the DescribeCustomKeyStores // operation. To reconnect a custom key store, use the ConnectCustomKeyStore // operation. // // If the operation succeeds, it returns a JSON object with no properties. // // Cross-account use: No. You cannot perform this operation on a custom key // store in a different Amazon Web Services account. // // Required permissions: kms:DisconnectCustomKeyStore (path_to_url // (IAM policy) // // Related operations: // // - ConnectCustomKeyStore // // - CreateCustomKeyStore // // - DeleteCustomKeyStore // // - DescribeCustomKeyStores // // - UpdateCustomKeyStore // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation DisconnectCustomKeyStore for usage and error information. // // Returned Error Types: // // - CustomKeyStoreInvalidStateException // The request was rejected because of the ConnectionState of the custom key // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores // operation. // // This exception is thrown under the following conditions: // // - You requested the ConnectCustomKeyStore operation on a custom key store // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid // for all other ConnectionState values. To reconnect a custom key store // in a FAILED state, disconnect it (DisconnectCustomKeyStore), then connect // it (ConnectCustomKeyStore). // // - You requested the CreateKey operation in a custom key store that is // not connected. This operations is valid only when the custom key store // ConnectionState is CONNECTED. // // - You requested the DisconnectCustomKeyStore operation on a custom key // store with a ConnectionState of DISCONNECTING or DISCONNECTED. This operation // is valid for all other ConnectionState values. // // - You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation // on a custom key store that is not disconnected. This operation is valid // only when the custom key store ConnectionState is DISCONNECTED. // // - You requested the GenerateRandom operation in an CloudHSM key store // that is not connected. This operation is valid only when the CloudHSM // key store ConnectionState is CONNECTED. // // - CustomKeyStoreNotFoundException // The request was rejected because KMS cannot find a custom key store with // the specified key store name or ID. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // See also, path_to_url func (c *KMS) DisconnectCustomKeyStore(input *DisconnectCustomKeyStoreInput) (*DisconnectCustomKeyStoreOutput, error) { req, out := c.DisconnectCustomKeyStoreRequest(input) return out, req.Send() } // DisconnectCustomKeyStoreWithContext is the same as DisconnectCustomKeyStore with the addition of // the ability to pass a context and additional request options. // // See DisconnectCustomKeyStore for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) DisconnectCustomKeyStoreWithContext(ctx aws.Context, input *DisconnectCustomKeyStoreInput, opts ...request.Option) (*DisconnectCustomKeyStoreOutput, error) { req, out := c.DisconnectCustomKeyStoreRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opEnableKey = "EnableKey" // EnableKeyRequest generates a "aws/request.Request" representing the // client's request for the EnableKey operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See EnableKey for more information on using the EnableKey // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the EnableKeyRequest method. // req, resp := client.EnableKeyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) EnableKeyRequest(input *EnableKeyInput) (req *request.Request, output *EnableKeyOutput) { op := &request.Operation{ Name: opEnableKey, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &EnableKeyInput{} } output = &EnableKeyOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // EnableKey API operation for AWS Key Management Service. // // Sets the key state of a KMS key to enabled. This allows you to use the KMS // key for cryptographic operations (path_to_url#cryptographic-operations). // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:EnableKey (path_to_url // (key policy) // // Related operations: DisableKey // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation EnableKey for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - LimitExceededException // The request was rejected because a quota was exceeded. For more information, // see Quotas (path_to_url // in the Key Management Service Developer Guide. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // See also, path_to_url func (c *KMS) EnableKey(input *EnableKeyInput) (*EnableKeyOutput, error) { req, out := c.EnableKeyRequest(input) return out, req.Send() } // EnableKeyWithContext is the same as EnableKey with the addition of // the ability to pass a context and additional request options. // // See EnableKey for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) EnableKeyWithContext(ctx aws.Context, input *EnableKeyInput, opts ...request.Option) (*EnableKeyOutput, error) { req, out := c.EnableKeyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opEnableKeyRotation = "EnableKeyRotation" // EnableKeyRotationRequest generates a "aws/request.Request" representing the // client's request for the EnableKeyRotation operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See EnableKeyRotation for more information on using the EnableKeyRotation // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the EnableKeyRotationRequest method. // req, resp := client.EnableKeyRotationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) (req *request.Request, output *EnableKeyRotationOutput) { op := &request.Operation{ Name: opEnableKeyRotation, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &EnableKeyRotationInput{} } output = &EnableKeyRotationOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // EnableKeyRotation API operation for AWS Key Management Service. // // Enables automatic rotation of the key material (path_to_url // of the specified symmetric encryption KMS key. // // When you enable automatic rotation of a customer managed KMS key (path_to_url#customer-cmk), // KMS rotates the key material of the KMS key one year (approximately 365 days) // from the enable date and every year thereafter. You can monitor rotation // of the key material for your KMS keys in CloudTrail and Amazon CloudWatch. // To disable rotation of the key material in a customer managed KMS key, use // the DisableKeyRotation operation. // // Automatic key rotation is supported only on symmetric encryption KMS keys // (path_to_url#symmetric-cmks). // You cannot enable automatic rotation of asymmetric KMS keys (path_to_url // HMAC KMS keys (path_to_url // KMS keys with imported key material (path_to_url // or KMS keys in a custom key store (path_to_url // To enable or disable automatic rotation of a set of related multi-Region // keys (path_to_url#multi-region-rotate), // set the property on the primary key. // // You cannot enable or disable automatic rotation Amazon Web Services managed // KMS keys (path_to_url#aws-managed-cmk). // KMS always rotates the key material of Amazon Web Services managed keys every // year. Rotation of Amazon Web Services owned KMS keys (path_to_url#aws-owned-cmk) // varies. // // In May 2022, KMS changed the rotation schedule for Amazon Web Services managed // keys from every three years (approximately 1,095 days) to every year (approximately // 365 days). // // New Amazon Web Services managed keys are automatically rotated one year after // they are created, and approximately every year thereafter. // // Existing Amazon Web Services managed keys are automatically rotated one year // after their most recent rotation, and every year thereafter. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:EnableKeyRotation (path_to_url // (key policy) // // Related operations: // // - DisableKeyRotation // // - GetKeyRotationStatus // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation EnableKeyRotation for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // // See also, path_to_url func (c *KMS) EnableKeyRotation(input *EnableKeyRotationInput) (*EnableKeyRotationOutput, error) { req, out := c.EnableKeyRotationRequest(input) return out, req.Send() } // EnableKeyRotationWithContext is the same as EnableKeyRotation with the addition of // the ability to pass a context and additional request options. // // See EnableKeyRotation for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) EnableKeyRotationWithContext(ctx aws.Context, input *EnableKeyRotationInput, opts ...request.Option) (*EnableKeyRotationOutput, error) { req, out := c.EnableKeyRotationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opEncrypt = "Encrypt" // EncryptRequest generates a "aws/request.Request" representing the // client's request for the Encrypt operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See Encrypt for more information on using the Encrypt // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the EncryptRequest method. // req, resp := client.EncryptRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) EncryptRequest(input *EncryptInput) (req *request.Request, output *EncryptOutput) { op := &request.Operation{ Name: opEncrypt, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &EncryptInput{} } output = &EncryptOutput{} req = c.newRequest(op, input, output) return } // Encrypt API operation for AWS Key Management Service. // // Encrypts plaintext of up to 4,096 bytes using a KMS key. You can use a symmetric // or asymmetric KMS key with a KeyUsage of ENCRYPT_DECRYPT. // // You can use this operation to encrypt small amounts of arbitrary data, such // as a personal identifier or database password, or other sensitive information. // You don't need to use the Encrypt operation to encrypt a data key. The GenerateDataKey // and GenerateDataKeyPair operations return a plaintext data key and an encrypted // copy of that data key. // // If you use a symmetric encryption KMS key, you can use an encryption context // to add additional security to your encryption operation. If you specify an // EncryptionContext when encrypting data, you must specify the same encryption // context (a case-sensitive exact match) when decrypting the data. Otherwise, // the request to decrypt fails with an InvalidCiphertextException. For more // information, see Encryption Context (path_to_url#encrypt_context) // in the Key Management Service Developer Guide. // // If you specify an asymmetric KMS key, you must also specify the encryption // algorithm. The algorithm must be compatible with the KMS key spec. // // When you use an asymmetric KMS key to encrypt or reencrypt data, be sure // to record the KMS key and encryption algorithm that you choose. You will // be required to provide the same KMS key and encryption algorithm when you // decrypt the data. If the KMS key and algorithm do not match the values used // to encrypt the data, the decrypt operation fails. // // You are not required to supply the key ID and encryption algorithm when you // decrypt with symmetric encryption KMS keys because KMS stores this information // in the ciphertext blob. KMS cannot store metadata in ciphertext generated // with asymmetric keys. The standard format for asymmetric key ciphertext does // not include configurable fields. // // The maximum size of the data that you can encrypt varies with the type of // KMS key and the encryption algorithm that you choose. // // - Symmetric encryption KMS keys SYMMETRIC_DEFAULT: 4096 bytes // // - RSA_2048 RSAES_OAEP_SHA_1: 214 bytes RSAES_OAEP_SHA_256: 190 bytes // // - RSA_3072 RSAES_OAEP_SHA_1: 342 bytes RSAES_OAEP_SHA_256: 318 bytes // // - RSA_4096 RSAES_OAEP_SHA_1: 470 bytes RSAES_OAEP_SHA_256: 446 bytes // // - SM2PKE: 1024 bytes (China Regions only) // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: Yes. To perform this operation with a KMS key in a different // Amazon Web Services account, specify the key ARN or alias ARN in the value // of the KeyId parameter. // // Required permissions: kms:Encrypt (path_to_url // (key policy) // // Related operations: // // - Decrypt // // - GenerateDataKey // // - GenerateDataKeyPair // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation Encrypt for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - KeyUnavailableException // The request was rejected because the specified KMS key was not available. // You can retry the request. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InvalidKeyUsageException // The request was rejected for one of the following reasons: // // - The KeyUsage value of the KMS key is incompatible with the API operation. // // - The encryption algorithm or signing algorithm specified for the operation // is incompatible with the type of key material in the KMS key (KeySpec). // // For encrypting, decrypting, re-encrypting, and generating data keys, the // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying messages, the // KeyUsage must be SIGN_VERIFY. For generating and verifying message authentication // codes (MACs), the KeyUsage must be GENERATE_VERIFY_MAC. To find the KeyUsage // of a KMS key, use the DescribeKey operation. // // To find the encryption or signing algorithms supported for a particular KMS // key, use the DescribeKey operation. // // - InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - DryRunOperationException // The request was rejected because the DryRun parameter was specified. // // See also, path_to_url func (c *KMS) Encrypt(input *EncryptInput) (*EncryptOutput, error) { req, out := c.EncryptRequest(input) return out, req.Send() } // EncryptWithContext is the same as Encrypt with the addition of // the ability to pass a context and additional request options. // // See Encrypt for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) EncryptWithContext(ctx aws.Context, input *EncryptInput, opts ...request.Option) (*EncryptOutput, error) { req, out := c.EncryptRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opGenerateDataKey = "GenerateDataKey" // GenerateDataKeyRequest generates a "aws/request.Request" representing the // client's request for the GenerateDataKey operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See GenerateDataKey for more information on using the GenerateDataKey // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the GenerateDataKeyRequest method. // req, resp := client.GenerateDataKeyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) GenerateDataKeyRequest(input *GenerateDataKeyInput) (req *request.Request, output *GenerateDataKeyOutput) { op := &request.Operation{ Name: opGenerateDataKey, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &GenerateDataKeyInput{} } output = &GenerateDataKeyOutput{} req = c.newRequest(op, input, output) return } // GenerateDataKey API operation for AWS Key Management Service. // // Returns a unique symmetric data key for use outside of KMS. This operation // returns a plaintext copy of the data key and a copy that is encrypted under // a symmetric encryption KMS key that you specify. The bytes in the plaintext // key are random; they are not related to the caller or the KMS key. You can // use the plaintext key to encrypt your data outside of KMS and store the encrypted // data key with the encrypted data. // // To generate a data key, specify the symmetric encryption KMS key that will // be used to encrypt the data key. You cannot use an asymmetric KMS key to // encrypt data keys. To get the type of your KMS key, use the DescribeKey operation. // // You must also specify the length of the data key. Use either the KeySpec // or NumberOfBytes parameters (but not both). For 128-bit and 256-bit data // keys, use the KeySpec parameter. // // To generate a 128-bit SM4 data key (China Regions only), specify a KeySpec // value of AES_128 or a NumberOfBytes value of 16. The symmetric encryption // key used in China Regions to encrypt your data key is an SM4 encryption key. // // To get only an encrypted copy of the data key, use GenerateDataKeyWithoutPlaintext. // To generate an asymmetric data key pair, use the GenerateDataKeyPair or GenerateDataKeyPairWithoutPlaintext // operation. To get a cryptographically secure random byte string, use GenerateRandom. // // You can use an optional encryption context to add additional security to // the encryption operation. If you specify an EncryptionContext, you must specify // the same encryption context (a case-sensitive exact match) when decrypting // the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException. // For more information, see Encryption Context (path_to_url#encrypt_context) // in the Key Management Service Developer Guide. // // GenerateDataKey also supports Amazon Web Services Nitro Enclaves (path_to_url // which provide an isolated compute environment in Amazon EC2. To call GenerateDataKey // for an Amazon Web Services Nitro enclave, use the Amazon Web Services Nitro // Enclaves SDK (path_to_url#sdk) // or any Amazon Web Services SDK. Use the Recipient parameter to provide the // attestation document for the enclave. GenerateDataKey returns a copy of the // data key encrypted under the specified KMS key, as usual. But instead of // a plaintext copy of the data key, the response includes a copy of the data // key encrypted under the public key from the attestation document (CiphertextForRecipient). // For information about the interaction between KMS and Amazon Web Services // Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS (path_to_url // in the Key Management Service Developer Guide.. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // # How to use your data key // // We recommend that you use the following pattern to encrypt data locally in // your application. You can write your own code or use a client-side encryption // library, such as the Amazon Web Services Encryption SDK (path_to_url // the Amazon DynamoDB Encryption Client (path_to_url // or Amazon S3 client-side encryption (path_to_url // to do these tasks for you. // // To encrypt data outside of KMS: // // Use the GenerateDataKey operation to get a data key. // // Use the plaintext data key (in the Plaintext field of the response) to encrypt // your data outside of KMS. Then erase the plaintext data key from memory. // // Store the encrypted data key (in the CiphertextBlob field of the response) // with the encrypted data. // // To decrypt data outside of KMS: // // Use the Decrypt operation to decrypt the encrypted data key. The operation // returns a plaintext copy of the data key. // // Use the plaintext data key to decrypt data outside of KMS, then erase the // plaintext data key from memory. // // Cross-account use: Yes. To perform this operation with a KMS key in a different // Amazon Web Services account, specify the key ARN or alias ARN in the value // of the KeyId parameter. // // Required permissions: kms:GenerateDataKey (path_to_url // (key policy) // // Related operations: // // - Decrypt // // - Encrypt // // - GenerateDataKeyPair // // - GenerateDataKeyPairWithoutPlaintext // // - GenerateDataKeyWithoutPlaintext // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation GenerateDataKey for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - KeyUnavailableException // The request was rejected because the specified KMS key was not available. // You can retry the request. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InvalidKeyUsageException // The request was rejected for one of the following reasons: // // - The KeyUsage value of the KMS key is incompatible with the API operation. // // - The encryption algorithm or signing algorithm specified for the operation // is incompatible with the type of key material in the KMS key (KeySpec). // // For encrypting, decrypting, re-encrypting, and generating data keys, the // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying messages, the // KeyUsage must be SIGN_VERIFY. For generating and verifying message authentication // codes (MACs), the KeyUsage must be GENERATE_VERIFY_MAC. To find the KeyUsage // of a KMS key, use the DescribeKey operation. // // To find the encryption or signing algorithms supported for a particular KMS // key, use the DescribeKey operation. // // - InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - DryRunOperationException // The request was rejected because the DryRun parameter was specified. // // See also, path_to_url func (c *KMS) GenerateDataKey(input *GenerateDataKeyInput) (*GenerateDataKeyOutput, error) { req, out := c.GenerateDataKeyRequest(input) return out, req.Send() } // GenerateDataKeyWithContext is the same as GenerateDataKey with the addition of // the ability to pass a context and additional request options. // // See GenerateDataKey for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) GenerateDataKeyWithContext(ctx aws.Context, input *GenerateDataKeyInput, opts ...request.Option) (*GenerateDataKeyOutput, error) { req, out := c.GenerateDataKeyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opGenerateDataKeyPair = "GenerateDataKeyPair" // GenerateDataKeyPairRequest generates a "aws/request.Request" representing the // client's request for the GenerateDataKeyPair operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See GenerateDataKeyPair for more information on using the GenerateDataKeyPair // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the GenerateDataKeyPairRequest method. // req, resp := client.GenerateDataKeyPairRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) GenerateDataKeyPairRequest(input *GenerateDataKeyPairInput) (req *request.Request, output *GenerateDataKeyPairOutput) { op := &request.Operation{ Name: opGenerateDataKeyPair, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &GenerateDataKeyPairInput{} } output = &GenerateDataKeyPairOutput{} req = c.newRequest(op, input, output) return } // GenerateDataKeyPair API operation for AWS Key Management Service. // // Returns a unique asymmetric data key pair for use outside of KMS. This operation // returns a plaintext public key, a plaintext private key, and a copy of the // private key that is encrypted under the symmetric encryption KMS key you // specify. You can use the data key pair to perform asymmetric cryptography // and implement digital signatures outside of KMS. The bytes in the keys are // random; they are not related to the caller or to the KMS key that is used // to encrypt the private key. // // You can use the public key that GenerateDataKeyPair returns to encrypt data // or verify a signature outside of KMS. Then, store the encrypted private key // with the data. When you are ready to decrypt data or sign a message, you // can use the Decrypt operation to decrypt the encrypted private key. // // To generate a data key pair, you must specify a symmetric encryption KMS // key to encrypt the private key in a data key pair. You cannot use an asymmetric // KMS key or a KMS key in a custom key store. To get the type and origin of // your KMS key, use the DescribeKey operation. // // Use the KeyPairSpec parameter to choose an RSA or Elliptic Curve (ECC) data // key pair. In China Regions, you can also choose an SM2 data key pair. KMS // recommends that you use ECC key pairs for signing, and use RSA and SM2 key // pairs for either encryption or signing, but not both. However, KMS cannot // enforce any restrictions on the use of data key pairs outside of KMS. // // If you are using the data key pair to encrypt data, or for any operation // where you don't immediately need a private key, consider using the GenerateDataKeyPairWithoutPlaintext // operation. GenerateDataKeyPairWithoutPlaintext returns a plaintext public // key and an encrypted private key, but omits the plaintext private key that // you need only to decrypt ciphertext or sign a message. Later, when you need // to decrypt the data or sign a message, use the Decrypt operation to decrypt // the encrypted private key in the data key pair. // // GenerateDataKeyPair returns a unique data key pair for each request. The // bytes in the keys are random; they are not related to the caller or the KMS // key that is used to encrypt the private key. The public key is a DER-encoded // X.509 SubjectPublicKeyInfo, as specified in RFC 5280 (path_to_url // The private key is a DER-encoded PKCS8 PrivateKeyInfo, as specified in RFC // 5958 (path_to_url // // GenerateDataKeyPair also supports Amazon Web Services Nitro Enclaves (path_to_url // which provide an isolated compute environment in Amazon EC2. To call GenerateDataKeyPair // for an Amazon Web Services Nitro enclave, use the Amazon Web Services Nitro // Enclaves SDK (path_to_url#sdk) // or any Amazon Web Services SDK. Use the Recipient parameter to provide the // attestation document for the enclave. GenerateDataKeyPair returns the public // data key and a copy of the private data key encrypted under the specified // KMS key, as usual. But instead of a plaintext copy of the private data key // (PrivateKeyPlaintext), the response includes a copy of the private data key // encrypted under the public key from the attestation document (CiphertextForRecipient). // For information about the interaction between KMS and Amazon Web Services // Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS (path_to_url // in the Key Management Service Developer Guide.. // // You can use an optional encryption context to add additional security to // the encryption operation. If you specify an EncryptionContext, you must specify // the same encryption context (a case-sensitive exact match) when decrypting // the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException. // For more information, see Encryption Context (path_to_url#encrypt_context) // in the Key Management Service Developer Guide. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: Yes. To perform this operation with a KMS key in a different // Amazon Web Services account, specify the key ARN or alias ARN in the value // of the KeyId parameter. // // Required permissions: kms:GenerateDataKeyPair (path_to_url // (key policy) // // Related operations: // // - Decrypt // // - Encrypt // // - GenerateDataKey // // - GenerateDataKeyPairWithoutPlaintext // // - GenerateDataKeyWithoutPlaintext // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation GenerateDataKeyPair for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - KeyUnavailableException // The request was rejected because the specified KMS key was not available. // You can retry the request. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InvalidKeyUsageException // The request was rejected for one of the following reasons: // // - The KeyUsage value of the KMS key is incompatible with the API operation. // // - The encryption algorithm or signing algorithm specified for the operation // is incompatible with the type of key material in the KMS key (KeySpec). // // For encrypting, decrypting, re-encrypting, and generating data keys, the // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying messages, the // KeyUsage must be SIGN_VERIFY. For generating and verifying message authentication // codes (MACs), the KeyUsage must be GENERATE_VERIFY_MAC. To find the KeyUsage // of a KMS key, use the DescribeKey operation. // // To find the encryption or signing algorithms supported for a particular KMS // key, use the DescribeKey operation. // // - InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // // - DryRunOperationException // The request was rejected because the DryRun parameter was specified. // // See also, path_to_url func (c *KMS) GenerateDataKeyPair(input *GenerateDataKeyPairInput) (*GenerateDataKeyPairOutput, error) { req, out := c.GenerateDataKeyPairRequest(input) return out, req.Send() } // GenerateDataKeyPairWithContext is the same as GenerateDataKeyPair with the addition of // the ability to pass a context and additional request options. // // See GenerateDataKeyPair for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) GenerateDataKeyPairWithContext(ctx aws.Context, input *GenerateDataKeyPairInput, opts ...request.Option) (*GenerateDataKeyPairOutput, error) { req, out := c.GenerateDataKeyPairRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opGenerateDataKeyPairWithoutPlaintext = "GenerateDataKeyPairWithoutPlaintext" // GenerateDataKeyPairWithoutPlaintextRequest generates a "aws/request.Request" representing the // client's request for the GenerateDataKeyPairWithoutPlaintext operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See GenerateDataKeyPairWithoutPlaintext for more information on using the GenerateDataKeyPairWithoutPlaintext // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the GenerateDataKeyPairWithoutPlaintextRequest method. // req, resp := client.GenerateDataKeyPairWithoutPlaintextRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) GenerateDataKeyPairWithoutPlaintextRequest(input *GenerateDataKeyPairWithoutPlaintextInput) (req *request.Request, output *GenerateDataKeyPairWithoutPlaintextOutput) { op := &request.Operation{ Name: opGenerateDataKeyPairWithoutPlaintext, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &GenerateDataKeyPairWithoutPlaintextInput{} } output = &GenerateDataKeyPairWithoutPlaintextOutput{} req = c.newRequest(op, input, output) return } // GenerateDataKeyPairWithoutPlaintext API operation for AWS Key Management Service. // // Returns a unique asymmetric data key pair for use outside of KMS. This operation // returns a plaintext public key and a copy of the private key that is encrypted // under the symmetric encryption KMS key you specify. Unlike GenerateDataKeyPair, // this operation does not return a plaintext private key. The bytes in the // keys are random; they are not related to the caller or to the KMS key that // is used to encrypt the private key. // // You can use the public key that GenerateDataKeyPairWithoutPlaintext returns // to encrypt data or verify a signature outside of KMS. Then, store the encrypted // private key with the data. When you are ready to decrypt data or sign a message, // you can use the Decrypt operation to decrypt the encrypted private key. // // To generate a data key pair, you must specify a symmetric encryption KMS // key to encrypt the private key in a data key pair. You cannot use an asymmetric // KMS key or a KMS key in a custom key store. To get the type and origin of // your KMS key, use the DescribeKey operation. // // Use the KeyPairSpec parameter to choose an RSA or Elliptic Curve (ECC) data // key pair. In China Regions, you can also choose an SM2 data key pair. KMS // recommends that you use ECC key pairs for signing, and use RSA and SM2 key // pairs for either encryption or signing, but not both. However, KMS cannot // enforce any restrictions on the use of data key pairs outside of KMS. // // GenerateDataKeyPairWithoutPlaintext returns a unique data key pair for each // request. The bytes in the key are not related to the caller or KMS key that // is used to encrypt the private key. The public key is a DER-encoded X.509 // SubjectPublicKeyInfo, as specified in RFC 5280 (path_to_url // // You can use an optional encryption context to add additional security to // the encryption operation. If you specify an EncryptionContext, you must specify // the same encryption context (a case-sensitive exact match) when decrypting // the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException. // For more information, see Encryption Context (path_to_url#encrypt_context) // in the Key Management Service Developer Guide. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: Yes. To perform this operation with a KMS key in a different // Amazon Web Services account, specify the key ARN or alias ARN in the value // of the KeyId parameter. // // Required permissions: kms:GenerateDataKeyPairWithoutPlaintext (path_to_url // (key policy) // // Related operations: // // - Decrypt // // - Encrypt // // - GenerateDataKey // // - GenerateDataKeyPair // // - GenerateDataKeyWithoutPlaintext // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation GenerateDataKeyPairWithoutPlaintext for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - KeyUnavailableException // The request was rejected because the specified KMS key was not available. // You can retry the request. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InvalidKeyUsageException // The request was rejected for one of the following reasons: // // - The KeyUsage value of the KMS key is incompatible with the API operation. // // - The encryption algorithm or signing algorithm specified for the operation // is incompatible with the type of key material in the KMS key (KeySpec). // // For encrypting, decrypting, re-encrypting, and generating data keys, the // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying messages, the // KeyUsage must be SIGN_VERIFY. For generating and verifying message authentication // codes (MACs), the KeyUsage must be GENERATE_VERIFY_MAC. To find the KeyUsage // of a KMS key, use the DescribeKey operation. // // To find the encryption or signing algorithms supported for a particular KMS // key, use the DescribeKey operation. // // - InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // // - DryRunOperationException // The request was rejected because the DryRun parameter was specified. // // See also, path_to_url func (c *KMS) GenerateDataKeyPairWithoutPlaintext(input *GenerateDataKeyPairWithoutPlaintextInput) (*GenerateDataKeyPairWithoutPlaintextOutput, error) { req, out := c.GenerateDataKeyPairWithoutPlaintextRequest(input) return out, req.Send() } // GenerateDataKeyPairWithoutPlaintextWithContext is the same as GenerateDataKeyPairWithoutPlaintext with the addition of // the ability to pass a context and additional request options. // // See GenerateDataKeyPairWithoutPlaintext for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) GenerateDataKeyPairWithoutPlaintextWithContext(ctx aws.Context, input *GenerateDataKeyPairWithoutPlaintextInput, opts ...request.Option) (*GenerateDataKeyPairWithoutPlaintextOutput, error) { req, out := c.GenerateDataKeyPairWithoutPlaintextRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext" // GenerateDataKeyWithoutPlaintextRequest generates a "aws/request.Request" representing the // client's request for the GenerateDataKeyWithoutPlaintext operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See GenerateDataKeyWithoutPlaintext for more information on using the GenerateDataKeyWithoutPlaintext // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the GenerateDataKeyWithoutPlaintextRequest method. // req, resp := client.GenerateDataKeyWithoutPlaintextRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) GenerateDataKeyWithoutPlaintextRequest(input *GenerateDataKeyWithoutPlaintextInput) (req *request.Request, output *GenerateDataKeyWithoutPlaintextOutput) { op := &request.Operation{ Name: opGenerateDataKeyWithoutPlaintext, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &GenerateDataKeyWithoutPlaintextInput{} } output = &GenerateDataKeyWithoutPlaintextOutput{} req = c.newRequest(op, input, output) return } // GenerateDataKeyWithoutPlaintext API operation for AWS Key Management Service. // // Returns a unique symmetric data key for use outside of KMS. This operation // returns a data key that is encrypted under a symmetric encryption KMS key // that you specify. The bytes in the key are random; they are not related to // the caller or to the KMS key. // // GenerateDataKeyWithoutPlaintext is identical to the GenerateDataKey operation // except that it does not return a plaintext copy of the data key. // // This operation is useful for systems that need to encrypt data at some point, // but not immediately. When you need to encrypt the data, you call the Decrypt // operation on the encrypted copy of the key. // // It's also useful in distributed systems with different levels of trust. For // example, you might store encrypted data in containers. One component of your // system creates new containers and stores an encrypted data key with each // container. Then, a different component puts the data into the containers. // That component first decrypts the data key, uses the plaintext data key to // encrypt data, puts the encrypted data into the container, and then destroys // the plaintext data key. In this system, the component that creates the containers // never sees the plaintext data key. // // To request an asymmetric data key pair, use the GenerateDataKeyPair or GenerateDataKeyPairWithoutPlaintext // operations. // // To generate a data key, you must specify the symmetric encryption KMS key // that is used to encrypt the data key. You cannot use an asymmetric KMS key // or a key in a custom key store to generate a data key. To get the type of // your KMS key, use the DescribeKey operation. // // You must also specify the length of the data key. Use either the KeySpec // or NumberOfBytes parameters (but not both). For 128-bit and 256-bit data // keys, use the KeySpec parameter. // // To generate an SM4 data key (China Regions only), specify a KeySpec value // of AES_128 or NumberOfBytes value of 16. The symmetric encryption key used // in China Regions to encrypt your data key is an SM4 encryption key. // // If the operation succeeds, you will find the encrypted copy of the data key // in the CiphertextBlob field. // // You can use an optional encryption context to add additional security to // the encryption operation. If you specify an EncryptionContext, you must specify // the same encryption context (a case-sensitive exact match) when decrypting // the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException. // For more information, see Encryption Context (path_to_url#encrypt_context) // in the Key Management Service Developer Guide. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: Yes. To perform this operation with a KMS key in a different // Amazon Web Services account, specify the key ARN or alias ARN in the value // of the KeyId parameter. // // Required permissions: kms:GenerateDataKeyWithoutPlaintext (path_to_url // (key policy) // // Related operations: // // - Decrypt // // - Encrypt // // - GenerateDataKey // // - GenerateDataKeyPair // // - GenerateDataKeyPairWithoutPlaintext // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation GenerateDataKeyWithoutPlaintext for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - KeyUnavailableException // The request was rejected because the specified KMS key was not available. // You can retry the request. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InvalidKeyUsageException // The request was rejected for one of the following reasons: // // - The KeyUsage value of the KMS key is incompatible with the API operation. // // - The encryption algorithm or signing algorithm specified for the operation // is incompatible with the type of key material in the KMS key (KeySpec). // // For encrypting, decrypting, re-encrypting, and generating data keys, the // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying messages, the // KeyUsage must be SIGN_VERIFY. For generating and verifying message authentication // codes (MACs), the KeyUsage must be GENERATE_VERIFY_MAC. To find the KeyUsage // of a KMS key, use the DescribeKey operation. // // To find the encryption or signing algorithms supported for a particular KMS // key, use the DescribeKey operation. // // - InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - DryRunOperationException // The request was rejected because the DryRun parameter was specified. // // See also, path_to_url func (c *KMS) GenerateDataKeyWithoutPlaintext(input *GenerateDataKeyWithoutPlaintextInput) (*GenerateDataKeyWithoutPlaintextOutput, error) { req, out := c.GenerateDataKeyWithoutPlaintextRequest(input) return out, req.Send() } // GenerateDataKeyWithoutPlaintextWithContext is the same as GenerateDataKeyWithoutPlaintext with the addition of // the ability to pass a context and additional request options. // // See GenerateDataKeyWithoutPlaintext for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) GenerateDataKeyWithoutPlaintextWithContext(ctx aws.Context, input *GenerateDataKeyWithoutPlaintextInput, opts ...request.Option) (*GenerateDataKeyWithoutPlaintextOutput, error) { req, out := c.GenerateDataKeyWithoutPlaintextRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opGenerateMac = "GenerateMac" // GenerateMacRequest generates a "aws/request.Request" representing the // client's request for the GenerateMac operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See GenerateMac for more information on using the GenerateMac // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the GenerateMacRequest method. // req, resp := client.GenerateMacRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) GenerateMacRequest(input *GenerateMacInput) (req *request.Request, output *GenerateMacOutput) { op := &request.Operation{ Name: opGenerateMac, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &GenerateMacInput{} } output = &GenerateMacOutput{} req = c.newRequest(op, input, output) return } // GenerateMac API operation for AWS Key Management Service. // // Generates a hash-based message authentication code (HMAC) for a message using // an HMAC KMS key and a MAC algorithm that the key supports. HMAC KMS keys // and the HMAC algorithms that KMS uses conform to industry standards defined // in RFC 2104 (path_to_url // // You can use value that GenerateMac returns in the VerifyMac operation to // demonstrate that the original message has not changed. Also, because a secret // key is used to create the hash, you can verify that the party that generated // the hash has the required secret key. You can also use the raw result to // implement HMAC-based algorithms such as key derivation functions. This operation // is part of KMS support for HMAC KMS keys. For details, see HMAC keys in KMS // (path_to_url in the // Key Management Service Developer Guide . // // Best practices recommend that you limit the time during which any signing // mechanism, including an HMAC, is effective. This deters an attack where the // actor uses a signed message to establish validity repeatedly or long after // the message is superseded. HMAC tags do not include a timestamp, but you // can include a timestamp in the token or message to help you detect when its // time to refresh the HMAC. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: Yes. To perform this operation with a KMS key in a different // Amazon Web Services account, specify the key ARN or alias ARN in the value // of the KeyId parameter. // // Required permissions: kms:GenerateMac (path_to_url // (key policy) // // Related operations: VerifyMac // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation GenerateMac for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - KeyUnavailableException // The request was rejected because the specified KMS key was not available. // You can retry the request. // // - InvalidKeyUsageException // The request was rejected for one of the following reasons: // // - The KeyUsage value of the KMS key is incompatible with the API operation. // // - The encryption algorithm or signing algorithm specified for the operation // is incompatible with the type of key material in the KMS key (KeySpec). // // For encrypting, decrypting, re-encrypting, and generating data keys, the // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying messages, the // KeyUsage must be SIGN_VERIFY. For generating and verifying message authentication // codes (MACs), the KeyUsage must be GENERATE_VERIFY_MAC. To find the KeyUsage // of a KMS key, use the DescribeKey operation. // // To find the encryption or signing algorithms supported for a particular KMS // key, use the DescribeKey operation. // // - InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - DryRunOperationException // The request was rejected because the DryRun parameter was specified. // // See also, path_to_url func (c *KMS) GenerateMac(input *GenerateMacInput) (*GenerateMacOutput, error) { req, out := c.GenerateMacRequest(input) return out, req.Send() } // GenerateMacWithContext is the same as GenerateMac with the addition of // the ability to pass a context and additional request options. // // See GenerateMac for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) GenerateMacWithContext(ctx aws.Context, input *GenerateMacInput, opts ...request.Option) (*GenerateMacOutput, error) { req, out := c.GenerateMacRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opGenerateRandom = "GenerateRandom" // GenerateRandomRequest generates a "aws/request.Request" representing the // client's request for the GenerateRandom operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See GenerateRandom for more information on using the GenerateRandom // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the GenerateRandomRequest method. // req, resp := client.GenerateRandomRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) GenerateRandomRequest(input *GenerateRandomInput) (req *request.Request, output *GenerateRandomOutput) { op := &request.Operation{ Name: opGenerateRandom, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &GenerateRandomInput{} } output = &GenerateRandomOutput{} req = c.newRequest(op, input, output) return } // GenerateRandom API operation for AWS Key Management Service. // // Returns a random byte string that is cryptographically secure. // // You must use the NumberOfBytes parameter to specify the length of the random // byte string. There is no default value for string length. // // By default, the random byte string is generated in KMS. To generate the byte // string in the CloudHSM cluster associated with an CloudHSM key store, use // the CustomKeyStoreId parameter. // // GenerateRandom also supports Amazon Web Services Nitro Enclaves (path_to_url // which provide an isolated compute environment in Amazon EC2. To call GenerateRandom // for a Nitro enclave, use the Amazon Web Services Nitro Enclaves SDK (path_to_url#sdk) // or any Amazon Web Services SDK. Use the Recipient parameter to provide the // attestation document for the enclave. Instead of plaintext bytes, the response // includes the plaintext bytes encrypted under the public key from the attestation // document (CiphertextForRecipient).For information about the interaction between // KMS and Amazon Web Services Nitro Enclaves, see How Amazon Web Services Nitro // Enclaves uses KMS (path_to_url // in the Key Management Service Developer Guide. // // For more information about entropy and random number generation, see Key // Management Service Cryptographic Details (path_to_url // // Cross-account use: Not applicable. GenerateRandom does not use any account-specific // resources, such as KMS keys. // // Required permissions: kms:GenerateRandom (path_to_url // (IAM policy) // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation GenerateRandom for usage and error information. // // Returned Error Types: // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // // - CustomKeyStoreNotFoundException // The request was rejected because KMS cannot find a custom key store with // the specified key store name or ID. // // - CustomKeyStoreInvalidStateException // The request was rejected because of the ConnectionState of the custom key // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores // operation. // // This exception is thrown under the following conditions: // // - You requested the ConnectCustomKeyStore operation on a custom key store // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid // for all other ConnectionState values. To reconnect a custom key store // in a FAILED state, disconnect it (DisconnectCustomKeyStore), then connect // it (ConnectCustomKeyStore). // // - You requested the CreateKey operation in a custom key store that is // not connected. This operations is valid only when the custom key store // ConnectionState is CONNECTED. // // - You requested the DisconnectCustomKeyStore operation on a custom key // store with a ConnectionState of DISCONNECTING or DISCONNECTED. This operation // is valid for all other ConnectionState values. // // - You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation // on a custom key store that is not disconnected. This operation is valid // only when the custom key store ConnectionState is DISCONNECTED. // // - You requested the GenerateRandom operation in an CloudHSM key store // that is not connected. This operation is valid only when the CloudHSM // key store ConnectionState is CONNECTED. // // See also, path_to_url func (c *KMS) GenerateRandom(input *GenerateRandomInput) (*GenerateRandomOutput, error) { req, out := c.GenerateRandomRequest(input) return out, req.Send() } // GenerateRandomWithContext is the same as GenerateRandom with the addition of // the ability to pass a context and additional request options. // // See GenerateRandom for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) GenerateRandomWithContext(ctx aws.Context, input *GenerateRandomInput, opts ...request.Option) (*GenerateRandomOutput, error) { req, out := c.GenerateRandomRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opGetKeyPolicy = "GetKeyPolicy" // GetKeyPolicyRequest generates a "aws/request.Request" representing the // client's request for the GetKeyPolicy operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See GetKeyPolicy for more information on using the GetKeyPolicy // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the GetKeyPolicyRequest method. // req, resp := client.GetKeyPolicyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) GetKeyPolicyRequest(input *GetKeyPolicyInput) (req *request.Request, output *GetKeyPolicyOutput) { op := &request.Operation{ Name: opGetKeyPolicy, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &GetKeyPolicyInput{} } output = &GetKeyPolicyOutput{} req = c.newRequest(op, input, output) return } // GetKeyPolicy API operation for AWS Key Management Service. // // Gets a key policy attached to the specified KMS key. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:GetKeyPolicy (path_to_url // (key policy) // // Related operations: PutKeyPolicy (path_to_url // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation GetKeyPolicy for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // See also, path_to_url func (c *KMS) GetKeyPolicy(input *GetKeyPolicyInput) (*GetKeyPolicyOutput, error) { req, out := c.GetKeyPolicyRequest(input) return out, req.Send() } // GetKeyPolicyWithContext is the same as GetKeyPolicy with the addition of // the ability to pass a context and additional request options. // // See GetKeyPolicy for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) GetKeyPolicyWithContext(ctx aws.Context, input *GetKeyPolicyInput, opts ...request.Option) (*GetKeyPolicyOutput, error) { req, out := c.GetKeyPolicyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opGetKeyRotationStatus = "GetKeyRotationStatus" // GetKeyRotationStatusRequest generates a "aws/request.Request" representing the // client's request for the GetKeyRotationStatus operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See GetKeyRotationStatus for more information on using the GetKeyRotationStatus // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the GetKeyRotationStatusRequest method. // req, resp := client.GetKeyRotationStatusRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) GetKeyRotationStatusRequest(input *GetKeyRotationStatusInput) (req *request.Request, output *GetKeyRotationStatusOutput) { op := &request.Operation{ Name: opGetKeyRotationStatus, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &GetKeyRotationStatusInput{} } output = &GetKeyRotationStatusOutput{} req = c.newRequest(op, input, output) return } // GetKeyRotationStatus API operation for AWS Key Management Service. // // Gets a Boolean value that indicates whether automatic rotation of the key // material (path_to_url // is enabled for the specified KMS key. // // When you enable automatic rotation for customer managed KMS keys (path_to_url#customer-cmk), // KMS rotates the key material of the KMS key one year (approximately 365 days) // from the enable date and every year thereafter. You can monitor rotation // of the key material for your KMS keys in CloudTrail and Amazon CloudWatch. // // Automatic key rotation is supported only on symmetric encryption KMS keys // (path_to_url#symmetric-cmks). // You cannot enable automatic rotation of asymmetric KMS keys (path_to_url // HMAC KMS keys (path_to_url // KMS keys with imported key material (path_to_url // or KMS keys in a custom key store (path_to_url // To enable or disable automatic rotation of a set of related multi-Region // keys (path_to_url#multi-region-rotate), // set the property on the primary key.. // // You can enable (EnableKeyRotation) and disable automatic rotation (DisableKeyRotation) // of the key material in customer managed KMS keys. Key material rotation of // Amazon Web Services managed KMS keys (path_to_url#aws-managed-cmk) // is not configurable. KMS always rotates the key material in Amazon Web Services // managed KMS keys every year. The key rotation status for Amazon Web Services // managed KMS keys is always true. // // In May 2022, KMS changed the rotation schedule for Amazon Web Services managed // keys from every three years to every year. For details, see EnableKeyRotation. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // - Disabled: The key rotation status does not change when you disable a // KMS key. However, while the KMS key is disabled, KMS does not rotate the // key material. When you re-enable the KMS key, rotation resumes. If the // key material in the re-enabled KMS key hasn't been rotated in one year, // KMS rotates it immediately, and every year thereafter. If it's been less // than a year since the key material in the re-enabled KMS key was rotated, // the KMS key resumes its prior rotation schedule. // // - Pending deletion: While a KMS key is pending deletion, its key rotation // status is false and KMS does not rotate the key material. If you cancel // the deletion, the original key rotation status returns to true. // // Cross-account use: Yes. To perform this operation on a KMS key in a different // Amazon Web Services account, specify the key ARN in the value of the KeyId // parameter. // // Required permissions: kms:GetKeyRotationStatus (path_to_url // (key policy) // // Related operations: // // - DisableKeyRotation // // - EnableKeyRotation // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation GetKeyRotationStatus for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // // See also, path_to_url func (c *KMS) GetKeyRotationStatus(input *GetKeyRotationStatusInput) (*GetKeyRotationStatusOutput, error) { req, out := c.GetKeyRotationStatusRequest(input) return out, req.Send() } // GetKeyRotationStatusWithContext is the same as GetKeyRotationStatus with the addition of // the ability to pass a context and additional request options. // // See GetKeyRotationStatus for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) GetKeyRotationStatusWithContext(ctx aws.Context, input *GetKeyRotationStatusInput, opts ...request.Option) (*GetKeyRotationStatusOutput, error) { req, out := c.GetKeyRotationStatusRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opGetParametersForImport = "GetParametersForImport" // GetParametersForImportRequest generates a "aws/request.Request" representing the // client's request for the GetParametersForImport operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See GetParametersForImport for more information on using the GetParametersForImport // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the GetParametersForImportRequest method. // req, resp := client.GetParametersForImportRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) GetParametersForImportRequest(input *GetParametersForImportInput) (req *request.Request, output *GetParametersForImportOutput) { op := &request.Operation{ Name: opGetParametersForImport, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &GetParametersForImportInput{} } output = &GetParametersForImportOutput{} req = c.newRequest(op, input, output) return } // GetParametersForImport API operation for AWS Key Management Service. // // Returns the public key and an import token you need to import or reimport // key material for a KMS key. // // By default, KMS keys are created with key material that KMS generates. This // operation supports Importing key material (path_to_url // an advanced feature that lets you generate and import the cryptographic key // material for a KMS key. For more information about importing key material // into KMS, see Importing key material (path_to_url // in the Key Management Service Developer Guide. // // Before calling GetParametersForImport, use the CreateKey operation with an // Origin value of EXTERNAL to create a KMS key with no key material. You can // import key material for a symmetric encryption KMS key, HMAC KMS key, asymmetric // encryption KMS key, or asymmetric signing KMS key. You can also import key // material into a multi-Region key (path_to_url // of any supported type. However, you can't import key material into a KMS // key in a custom key store (path_to_url // You can also use GetParametersForImport to get a public key and import token // to reimport the original key material (path_to_url#reimport-key-material) // into a KMS key whose key material expired or was deleted. // // GetParametersForImport returns the items that you need to import your key // material. // // - The public key (or "wrapping key") of an RSA key pair that KMS generates. // You will use this public key to encrypt ("wrap") your key material while // it's in transit to KMS. // // - A import token that ensures that KMS can decrypt your key material and // associate it with the correct KMS key. // // The public key and its import token are permanently linked and must be used // together. Each public key and import token set is valid for 24 hours. The // expiration date and time appear in the ParametersValidTo field in the GetParametersForImport // response. You cannot use an expired public key or import token in an ImportKeyMaterial // request. If your key and token expire, send another GetParametersForImport // request. // // GetParametersForImport requires the following information: // // - The key ID of the KMS key for which you are importing the key material. // // - The key spec of the public key ("wrapping key") that you will use to // encrypt your key material during import. // // - The wrapping algorithm that you will use with the public key to encrypt // your key material. // // You can use the same or a different public key spec and wrapping algorithm // each time you import or reimport the same key material. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:GetParametersForImport (path_to_url // (key policy) // // Related operations: // // - ImportKeyMaterial // // - DeleteImportedKeyMaterial // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation GetParametersForImport for usage and error information. // // Returned Error Types: // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // See also, path_to_url func (c *KMS) GetParametersForImport(input *GetParametersForImportInput) (*GetParametersForImportOutput, error) { req, out := c.GetParametersForImportRequest(input) return out, req.Send() } // GetParametersForImportWithContext is the same as GetParametersForImport with the addition of // the ability to pass a context and additional request options. // // See GetParametersForImport for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) GetParametersForImportWithContext(ctx aws.Context, input *GetParametersForImportInput, opts ...request.Option) (*GetParametersForImportOutput, error) { req, out := c.GetParametersForImportRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opGetPublicKey = "GetPublicKey" // GetPublicKeyRequest generates a "aws/request.Request" representing the // client's request for the GetPublicKey operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See GetPublicKey for more information on using the GetPublicKey // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the GetPublicKeyRequest method. // req, resp := client.GetPublicKeyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) GetPublicKeyRequest(input *GetPublicKeyInput) (req *request.Request, output *GetPublicKeyOutput) { op := &request.Operation{ Name: opGetPublicKey, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &GetPublicKeyInput{} } output = &GetPublicKeyOutput{} req = c.newRequest(op, input, output) return } // GetPublicKey API operation for AWS Key Management Service. // // Returns the public key of an asymmetric KMS key. Unlike the private key of // a asymmetric KMS key, which never leaves KMS unencrypted, callers with kms:GetPublicKey // permission can download the public key of an asymmetric KMS key. You can // share the public key to allow others to encrypt messages and verify signatures // outside of KMS. For information about asymmetric KMS keys, see Asymmetric // KMS keys (path_to_url // in the Key Management Service Developer Guide. // // You do not need to download the public key. Instead, you can use the public // key within KMS by calling the Encrypt, ReEncrypt, or Verify operations with // the identifier of an asymmetric KMS key. When you use the public key within // KMS, you benefit from the authentication, authorization, and logging that // are part of every KMS operation. You also reduce of risk of encrypting data // that cannot be decrypted. These features are not effective outside of KMS. // // To help you use the public key safely outside of KMS, GetPublicKey returns // important information about the public key in the response, including: // // - KeySpec (path_to_url#KMS-GetPublicKey-response-KeySpec): // The type of key material in the public key, such as RSA_4096 or ECC_NIST_P521. // // - KeyUsage (path_to_url#KMS-GetPublicKey-response-KeyUsage): // Whether the key is used for encryption or signing. // // - EncryptionAlgorithms (path_to_url#KMS-GetPublicKey-response-EncryptionAlgorithms) // or SigningAlgorithms (path_to_url#KMS-GetPublicKey-response-SigningAlgorithms): // A list of the encryption algorithms or the signing algorithms for the // key. // // Although KMS cannot enforce these restrictions on external operations, it // is crucial that you use this information to prevent the public key from being // used improperly. For example, you can prevent a public signing key from being // used encrypt data, or prevent a public key from being used with an encryption // algorithm that is not supported by KMS. You can also avoid errors, such as // using the wrong signing algorithm in a verification operation. // // To verify a signature outside of KMS with an SM2 public key (China Regions // only), you must specify the distinguishing ID. By default, KMS uses 1234567812345678 // as the distinguishing ID. For more information, see Offline verification // with SM2 key pairs (path_to_url#key-spec-sm-offline-verification). // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: Yes. To perform this operation with a KMS key in a different // Amazon Web Services account, specify the key ARN or alias ARN in the value // of the KeyId parameter. // // Required permissions: kms:GetPublicKey (path_to_url // (key policy) // // Related operations: CreateKey // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation GetPublicKey for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - KeyUnavailableException // The request was rejected because the specified KMS key was not available. // You can retry the request. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // // - InvalidKeyUsageException // The request was rejected for one of the following reasons: // // - The KeyUsage value of the KMS key is incompatible with the API operation. // // - The encryption algorithm or signing algorithm specified for the operation // is incompatible with the type of key material in the KMS key (KeySpec). // // For encrypting, decrypting, re-encrypting, and generating data keys, the // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying messages, the // KeyUsage must be SIGN_VERIFY. For generating and verifying message authentication // codes (MACs), the KeyUsage must be GENERATE_VERIFY_MAC. To find the KeyUsage // of a KMS key, use the DescribeKey operation. // // To find the encryption or signing algorithms supported for a particular KMS // key, use the DescribeKey operation. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // See also, path_to_url func (c *KMS) GetPublicKey(input *GetPublicKeyInput) (*GetPublicKeyOutput, error) { req, out := c.GetPublicKeyRequest(input) return out, req.Send() } // GetPublicKeyWithContext is the same as GetPublicKey with the addition of // the ability to pass a context and additional request options. // // See GetPublicKey for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) GetPublicKeyWithContext(ctx aws.Context, input *GetPublicKeyInput, opts ...request.Option) (*GetPublicKeyOutput, error) { req, out := c.GetPublicKeyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opImportKeyMaterial = "ImportKeyMaterial" // ImportKeyMaterialRequest generates a "aws/request.Request" representing the // client's request for the ImportKeyMaterial operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See ImportKeyMaterial for more information on using the ImportKeyMaterial // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the ImportKeyMaterialRequest method. // req, resp := client.ImportKeyMaterialRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) ImportKeyMaterialRequest(input *ImportKeyMaterialInput) (req *request.Request, output *ImportKeyMaterialOutput) { op := &request.Operation{ Name: opImportKeyMaterial, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &ImportKeyMaterialInput{} } output = &ImportKeyMaterialOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // ImportKeyMaterial API operation for AWS Key Management Service. // // Imports or reimports key material into an existing KMS key that was created // without key material. ImportKeyMaterial also sets the expiration model and // expiration date of the imported key material. // // By default, KMS keys are created with key material that KMS generates. This // operation supports Importing key material (path_to_url // an advanced feature that lets you generate and import the cryptographic key // material for a KMS key. For more information about importing key material // into KMS, see Importing key material (path_to_url // in the Key Management Service Developer Guide. // // After you successfully import key material into a KMS key, you can reimport // the same key material (path_to_url#reimport-key-material) // into that KMS key, but you cannot import different key material. You might // reimport key material to replace key material that expired or key material // that you deleted. You might also reimport key material to change the expiration // model or expiration date of the key material. // // Each time you import key material into KMS, you can determine whether (ExpirationModel) // and when (ValidTo) the key material expires. To change the expiration of // your key material, you must import it again, either by calling ImportKeyMaterial // or using the import features (kms/latest/developerguide/importing-keys-import-key-material.html#importing-keys-import-key-material-console) // of the KMS console. // // Before calling ImportKeyMaterial: // // - Create or identify a KMS key with no key material. The KMS key must // have an Origin value of EXTERNAL, which indicates that the KMS key is // designed for imported key material. To create an new KMS key for imported // key material, call the CreateKey operation with an Origin value of EXTERNAL. // You can create a symmetric encryption KMS key, HMAC KMS key, asymmetric // encryption KMS key, or asymmetric signing KMS key. You can also import // key material into a multi-Region key (kms/latest/developerguide/multi-region-keys-overview.html) // of any supported type. However, you can't import key material into a KMS // key in a custom key store (kms/latest/developerguide/custom-key-store-overview.html). // // - Use the DescribeKey operation to verify that the KeyState of the KMS // key is PendingImport, which indicates that the KMS key has no key material. // If you are reimporting the same key material into an existing KMS key, // you might need to call the DeleteImportedKeyMaterial to delete its existing // key material. // // - Call the GetParametersForImport operation to get a public key and import // token set for importing key material. // // - Use the public key in the GetParametersForImport response to encrypt // your key material. // // Then, in an ImportKeyMaterial request, you submit your encrypted key material // and import token. When calling this operation, you must specify the following // values: // // - The key ID or key ARN of the KMS key to associate with the imported // key material. Its Origin must be EXTERNAL and its KeyState must be PendingImport. // You cannot perform this operation on a KMS key in a custom key store (kms/latest/developerguide/custom-key-store-overview.html), // or on a KMS key in a different Amazon Web Services account. To get the // Origin and KeyState of a KMS key, call DescribeKey. // // - The encrypted key material. // // - The import token that GetParametersForImport returned. You must use // a public key and token from the same GetParametersForImport response. // // - Whether the key material expires (ExpirationModel) and, if so, when // (ValidTo). For help with this choice, see Setting an expiration time (path_to_url#importing-keys-expiration) // in the Key Management Service Developer Guide. If you set an expiration // date, KMS deletes the key material from the KMS key on the specified date, // making the KMS key unusable. To use the KMS key in cryptographic operations // again, you must reimport the same key material. However, you can delete // and reimport the key material at any time, including before the key material // expires. Each time you reimport, you can eliminate or reset the expiration // time. // // When this operation is successful, the key state of the KMS key changes from // PendingImport to Enabled, and you can use the KMS key in cryptographic operations. // // If this operation fails, use the exception to help determine the problem. // If the error is related to the key material, the import token, or wrapping // key, use GetParametersForImport to get a new public key and import token // for the KMS key and repeat the import procedure. For help, see How To Import // Key Material (path_to_url#importing-keys-overview) // in the Key Management Service Developer Guide. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:ImportKeyMaterial (path_to_url // (key policy) // // Related operations: // // - DeleteImportedKeyMaterial // // - GetParametersForImport // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation ImportKeyMaterial for usage and error information. // // Returned Error Types: // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - InvalidCiphertextException // From the Decrypt or ReEncrypt operation, the request was rejected because // the specified ciphertext, or additional authenticated data incorporated into // the ciphertext, such as the encryption context, is corrupted, missing, or // otherwise invalid. // // From the ImportKeyMaterial operation, the request was rejected because KMS // could not decrypt the encrypted (wrapped) key material. // // - IncorrectKeyMaterialException // The request was rejected because the key material in the request is, expired, // invalid, or is not the same key material that was previously imported into // this KMS key. // // - ExpiredImportTokenException // The request was rejected because the specified import token is expired. Use // GetParametersForImport to get a new import token and public key, use the // new public key to encrypt the key material, and then try the request again. // // - InvalidImportTokenException // The request was rejected because the provided import token is invalid or // is associated with a different KMS key. // // See also, path_to_url func (c *KMS) ImportKeyMaterial(input *ImportKeyMaterialInput) (*ImportKeyMaterialOutput, error) { req, out := c.ImportKeyMaterialRequest(input) return out, req.Send() } // ImportKeyMaterialWithContext is the same as ImportKeyMaterial with the addition of // the ability to pass a context and additional request options. // // See ImportKeyMaterial for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ImportKeyMaterialWithContext(ctx aws.Context, input *ImportKeyMaterialInput, opts ...request.Option) (*ImportKeyMaterialOutput, error) { req, out := c.ImportKeyMaterialRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opListAliases = "ListAliases" // ListAliasesRequest generates a "aws/request.Request" representing the // client's request for the ListAliases operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See ListAliases for more information on using the ListAliases // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the ListAliasesRequest method. // req, resp := client.ListAliasesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, output *ListAliasesOutput) { op := &request.Operation{ Name: opListAliases, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"NextMarker"}, LimitToken: "Limit", TruncationToken: "", }, } if input == nil { input = &ListAliasesInput{} } output = &ListAliasesOutput{} req = c.newRequest(op, input, output) return } // ListAliases API operation for AWS Key Management Service. // // Gets a list of aliases in the caller's Amazon Web Services account and region. // For more information about aliases, see CreateAlias. // // By default, the ListAliases operation returns all aliases in the account // and region. To get only the aliases associated with a particular KMS key, // use the KeyId parameter. // // The ListAliases response can include aliases that you created and associated // with your customer managed keys, and aliases that Amazon Web Services created // and associated with Amazon Web Services managed keys in your account. You // can recognize Amazon Web Services aliases because their names have the format // aws/<service-name>, such as aws/dynamodb. // // The response might also include aliases that have no TargetKeyId field. These // are predefined aliases that Amazon Web Services has created but has not yet // associated with a KMS key. Aliases that Amazon Web Services creates in your // account, including predefined aliases, do not count against your KMS aliases // quota (path_to_url#aliases-limit). // // Cross-account use: No. ListAliases does not return aliases in other Amazon // Web Services accounts. // // Required permissions: kms:ListAliases (path_to_url // (IAM policy) // // For details, see Controlling access to aliases (path_to_url#alias-access) // in the Key Management Service Developer Guide. // // Related operations: // // - CreateAlias // // - DeleteAlias // // - UpdateAlias // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation ListAliases for usage and error information. // // Returned Error Types: // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InvalidMarkerException // The request was rejected because the marker that specifies where pagination // should next begin is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // See also, path_to_url func (c *KMS) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error) { req, out := c.ListAliasesRequest(input) return out, req.Send() } // ListAliasesWithContext is the same as ListAliases with the addition of // the ability to pass a context and additional request options. // // See ListAliases for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ListAliasesWithContext(ctx aws.Context, input *ListAliasesInput, opts ...request.Option) (*ListAliasesOutput, error) { req, out := c.ListAliasesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } // ListAliasesPages iterates over the pages of a ListAliases operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // // See ListAliases method for more information on how to use this operation. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListAliases operation. // pageNum := 0 // err := client.ListAliasesPages(params, // func(page *kms.ListAliasesOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) func (c *KMS) ListAliasesPages(input *ListAliasesInput, fn func(*ListAliasesOutput, bool) bool) error { return c.ListAliasesPagesWithContext(aws.BackgroundContext(), input, fn) } // ListAliasesPagesWithContext same as ListAliasesPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ListAliasesPagesWithContext(ctx aws.Context, input *ListAliasesInput, fn func(*ListAliasesOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { var inCpy *ListAliasesInput if input != nil { tmp := *input inCpy = &tmp } req, _ := c.ListAliasesRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } for p.Next() { if !fn(p.Page().(*ListAliasesOutput), !p.HasNextPage()) { break } } return p.Err() } const opListGrants = "ListGrants" // ListGrantsRequest generates a "aws/request.Request" representing the // client's request for the ListGrants operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See ListGrants for more information on using the ListGrants // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the ListGrantsRequest method. // req, resp := client.ListGrantsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) ListGrantsRequest(input *ListGrantsInput) (req *request.Request, output *ListGrantsResponse) { op := &request.Operation{ Name: opListGrants, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"NextMarker"}, LimitToken: "Limit", TruncationToken: "", }, } if input == nil { input = &ListGrantsInput{} } output = &ListGrantsResponse{} req = c.newRequest(op, input, output) return } // ListGrants API operation for AWS Key Management Service. // // Gets a list of all grants for the specified KMS key. // // You must specify the KMS key in all requests. You can filter the grant list // by grant ID or grantee principal. // // For detailed information about grants, including grant terminology, see Grants // in KMS (path_to_url // in the Key Management Service Developer Guide . For examples of working with // grants in several programming languages, see Programming grants (path_to_url // // The GranteePrincipal field in the ListGrants response usually contains the // user or role designated as the grantee principal in the grant. However, when // the grantee principal in the grant is an Amazon Web Services service, the // GranteePrincipal field contains the service principal (path_to_url#principal-services), // which might represent several different grantee principals. // // Cross-account use: Yes. To perform this operation on a KMS key in a different // Amazon Web Services account, specify the key ARN in the value of the KeyId // parameter. // // Required permissions: kms:ListGrants (path_to_url // (key policy) // // Related operations: // // - CreateGrant // // - ListRetirableGrants // // - RetireGrant // // - RevokeGrant // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation ListGrants for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InvalidMarkerException // The request was rejected because the marker that specifies where pagination // should next begin is not valid. // // - InvalidGrantIdException // The request was rejected because the specified GrantId is not valid. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // See also, path_to_url func (c *KMS) ListGrants(input *ListGrantsInput) (*ListGrantsResponse, error) { req, out := c.ListGrantsRequest(input) return out, req.Send() } // ListGrantsWithContext is the same as ListGrants with the addition of // the ability to pass a context and additional request options. // // See ListGrants for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ListGrantsWithContext(ctx aws.Context, input *ListGrantsInput, opts ...request.Option) (*ListGrantsResponse, error) { req, out := c.ListGrantsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } // ListGrantsPages iterates over the pages of a ListGrants operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // // See ListGrants method for more information on how to use this operation. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListGrants operation. // pageNum := 0 // err := client.ListGrantsPages(params, // func(page *kms.ListGrantsResponse, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) func (c *KMS) ListGrantsPages(input *ListGrantsInput, fn func(*ListGrantsResponse, bool) bool) error { return c.ListGrantsPagesWithContext(aws.BackgroundContext(), input, fn) } // ListGrantsPagesWithContext same as ListGrantsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ListGrantsPagesWithContext(ctx aws.Context, input *ListGrantsInput, fn func(*ListGrantsResponse, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { var inCpy *ListGrantsInput if input != nil { tmp := *input inCpy = &tmp } req, _ := c.ListGrantsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } for p.Next() { if !fn(p.Page().(*ListGrantsResponse), !p.HasNextPage()) { break } } return p.Err() } const opListKeyPolicies = "ListKeyPolicies" // ListKeyPoliciesRequest generates a "aws/request.Request" representing the // client's request for the ListKeyPolicies operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See ListKeyPolicies for more information on using the ListKeyPolicies // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the ListKeyPoliciesRequest method. // req, resp := client.ListKeyPoliciesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) ListKeyPoliciesRequest(input *ListKeyPoliciesInput) (req *request.Request, output *ListKeyPoliciesOutput) { op := &request.Operation{ Name: opListKeyPolicies, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"NextMarker"}, LimitToken: "Limit", TruncationToken: "", }, } if input == nil { input = &ListKeyPoliciesInput{} } output = &ListKeyPoliciesOutput{} req = c.newRequest(op, input, output) return } // ListKeyPolicies API operation for AWS Key Management Service. // // Gets the names of the key policies that are attached to a KMS key. This operation // is designed to get policy names that you can use in a GetKeyPolicy operation. // However, the only valid policy name is default. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:ListKeyPolicies (path_to_url // (key policy) // // Related operations: // // - GetKeyPolicy // // - PutKeyPolicy (path_to_url // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation ListKeyPolicies for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // See also, path_to_url func (c *KMS) ListKeyPolicies(input *ListKeyPoliciesInput) (*ListKeyPoliciesOutput, error) { req, out := c.ListKeyPoliciesRequest(input) return out, req.Send() } // ListKeyPoliciesWithContext is the same as ListKeyPolicies with the addition of // the ability to pass a context and additional request options. // // See ListKeyPolicies for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ListKeyPoliciesWithContext(ctx aws.Context, input *ListKeyPoliciesInput, opts ...request.Option) (*ListKeyPoliciesOutput, error) { req, out := c.ListKeyPoliciesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } // ListKeyPoliciesPages iterates over the pages of a ListKeyPolicies operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // // See ListKeyPolicies method for more information on how to use this operation. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListKeyPolicies operation. // pageNum := 0 // err := client.ListKeyPoliciesPages(params, // func(page *kms.ListKeyPoliciesOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) func (c *KMS) ListKeyPoliciesPages(input *ListKeyPoliciesInput, fn func(*ListKeyPoliciesOutput, bool) bool) error { return c.ListKeyPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) } // ListKeyPoliciesPagesWithContext same as ListKeyPoliciesPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ListKeyPoliciesPagesWithContext(ctx aws.Context, input *ListKeyPoliciesInput, fn func(*ListKeyPoliciesOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { var inCpy *ListKeyPoliciesInput if input != nil { tmp := *input inCpy = &tmp } req, _ := c.ListKeyPoliciesRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } for p.Next() { if !fn(p.Page().(*ListKeyPoliciesOutput), !p.HasNextPage()) { break } } return p.Err() } const opListKeys = "ListKeys" // ListKeysRequest generates a "aws/request.Request" representing the // client's request for the ListKeys operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See ListKeys for more information on using the ListKeys // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the ListKeysRequest method. // req, resp := client.ListKeysRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) ListKeysRequest(input *ListKeysInput) (req *request.Request, output *ListKeysOutput) { op := &request.Operation{ Name: opListKeys, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"NextMarker"}, LimitToken: "Limit", TruncationToken: "", }, } if input == nil { input = &ListKeysInput{} } output = &ListKeysOutput{} req = c.newRequest(op, input, output) return } // ListKeys API operation for AWS Key Management Service. // // Gets a list of all KMS keys in the caller's Amazon Web Services account and // Region. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:ListKeys (path_to_url // (IAM policy) // // Related operations: // // - CreateKey // // - DescribeKey // // - ListAliases // // - ListResourceTags // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation ListKeys for usage and error information. // // Returned Error Types: // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidMarkerException // The request was rejected because the marker that specifies where pagination // should next begin is not valid. // // See also, path_to_url func (c *KMS) ListKeys(input *ListKeysInput) (*ListKeysOutput, error) { req, out := c.ListKeysRequest(input) return out, req.Send() } // ListKeysWithContext is the same as ListKeys with the addition of // the ability to pass a context and additional request options. // // See ListKeys for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ListKeysWithContext(ctx aws.Context, input *ListKeysInput, opts ...request.Option) (*ListKeysOutput, error) { req, out := c.ListKeysRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } // ListKeysPages iterates over the pages of a ListKeys operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // // See ListKeys method for more information on how to use this operation. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListKeys operation. // pageNum := 0 // err := client.ListKeysPages(params, // func(page *kms.ListKeysOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) func (c *KMS) ListKeysPages(input *ListKeysInput, fn func(*ListKeysOutput, bool) bool) error { return c.ListKeysPagesWithContext(aws.BackgroundContext(), input, fn) } // ListKeysPagesWithContext same as ListKeysPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ListKeysPagesWithContext(ctx aws.Context, input *ListKeysInput, fn func(*ListKeysOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { var inCpy *ListKeysInput if input != nil { tmp := *input inCpy = &tmp } req, _ := c.ListKeysRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } for p.Next() { if !fn(p.Page().(*ListKeysOutput), !p.HasNextPage()) { break } } return p.Err() } const opListResourceTags = "ListResourceTags" // ListResourceTagsRequest generates a "aws/request.Request" representing the // client's request for the ListResourceTags operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See ListResourceTags for more information on using the ListResourceTags // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the ListResourceTagsRequest method. // req, resp := client.ListResourceTagsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) ListResourceTagsRequest(input *ListResourceTagsInput) (req *request.Request, output *ListResourceTagsOutput) { op := &request.Operation{ Name: opListResourceTags, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"NextMarker"}, LimitToken: "Limit", TruncationToken: "", }, } if input == nil { input = &ListResourceTagsInput{} } output = &ListResourceTagsOutput{} req = c.newRequest(op, input, output) return } // ListResourceTags API operation for AWS Key Management Service. // // Returns all tags on the specified KMS key. // // For general information about tags, including the format and syntax, see // Tagging Amazon Web Services resources (path_to_url // in the Amazon Web Services General Reference. For information about using // tags in KMS, see Tagging keys (path_to_url // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:ListResourceTags (path_to_url // (key policy) // // Related operations: // // - CreateKey // // - ReplicateKey // // - TagResource // // - UntagResource // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation ListResourceTags for usage and error information. // // Returned Error Types: // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - InvalidMarkerException // The request was rejected because the marker that specifies where pagination // should next begin is not valid. // // See also, path_to_url func (c *KMS) ListResourceTags(input *ListResourceTagsInput) (*ListResourceTagsOutput, error) { req, out := c.ListResourceTagsRequest(input) return out, req.Send() } // ListResourceTagsWithContext is the same as ListResourceTags with the addition of // the ability to pass a context and additional request options. // // See ListResourceTags for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ListResourceTagsWithContext(ctx aws.Context, input *ListResourceTagsInput, opts ...request.Option) (*ListResourceTagsOutput, error) { req, out := c.ListResourceTagsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } // ListResourceTagsPages iterates over the pages of a ListResourceTags operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // // See ListResourceTags method for more information on how to use this operation. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListResourceTags operation. // pageNum := 0 // err := client.ListResourceTagsPages(params, // func(page *kms.ListResourceTagsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) func (c *KMS) ListResourceTagsPages(input *ListResourceTagsInput, fn func(*ListResourceTagsOutput, bool) bool) error { return c.ListResourceTagsPagesWithContext(aws.BackgroundContext(), input, fn) } // ListResourceTagsPagesWithContext same as ListResourceTagsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ListResourceTagsPagesWithContext(ctx aws.Context, input *ListResourceTagsInput, fn func(*ListResourceTagsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { var inCpy *ListResourceTagsInput if input != nil { tmp := *input inCpy = &tmp } req, _ := c.ListResourceTagsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } for p.Next() { if !fn(p.Page().(*ListResourceTagsOutput), !p.HasNextPage()) { break } } return p.Err() } const opListRetirableGrants = "ListRetirableGrants" // ListRetirableGrantsRequest generates a "aws/request.Request" representing the // client's request for the ListRetirableGrants operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See ListRetirableGrants for more information on using the ListRetirableGrants // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the ListRetirableGrantsRequest method. // req, resp := client.ListRetirableGrantsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) ListRetirableGrantsRequest(input *ListRetirableGrantsInput) (req *request.Request, output *ListGrantsResponse) { op := &request.Operation{ Name: opListRetirableGrants, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"NextMarker"}, LimitToken: "Limit", TruncationToken: "", }, } if input == nil { input = &ListRetirableGrantsInput{} } output = &ListGrantsResponse{} req = c.newRequest(op, input, output) return } // ListRetirableGrants API operation for AWS Key Management Service. // // Returns information about all grants in the Amazon Web Services account and // Region that have the specified retiring principal. // // You can specify any principal in your Amazon Web Services account. The grants // that are returned include grants for KMS keys in your Amazon Web Services // account and other Amazon Web Services accounts. You might use this operation // to determine which grants you may retire. To retire a grant, use the RetireGrant // operation. // // For detailed information about grants, including grant terminology, see Grants // in KMS (path_to_url // in the Key Management Service Developer Guide . For examples of working with // grants in several programming languages, see Programming grants (path_to_url // // Cross-account use: You must specify a principal in your Amazon Web Services // account. This operation returns a list of grants where the retiring principal // specified in the ListRetirableGrants request is the same retiring principal // on the grant. This can include grants on KMS keys owned by other Amazon Web // Services accounts, but you do not need kms:ListRetirableGrants permission // (or any other additional permission) in any Amazon Web Services account other // than your own. // // Required permissions: kms:ListRetirableGrants (path_to_url // (IAM policy) in your Amazon Web Services account. // // KMS authorizes ListRetirableGrants requests by evaluating the caller account's // kms:ListRetirableGrants permissions. The authorized resource in ListRetirableGrants // calls is the retiring principal specified in the request. KMS does not evaluate // the caller's permissions to verify their access to any KMS keys or grants // that might be returned by the ListRetirableGrants call. // // Related operations: // // - CreateGrant // // - ListGrants // // - RetireGrant // // - RevokeGrant // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation ListRetirableGrants for usage and error information. // // Returned Error Types: // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InvalidMarkerException // The request was rejected because the marker that specifies where pagination // should next begin is not valid. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // See also, path_to_url func (c *KMS) ListRetirableGrants(input *ListRetirableGrantsInput) (*ListGrantsResponse, error) { req, out := c.ListRetirableGrantsRequest(input) return out, req.Send() } // ListRetirableGrantsWithContext is the same as ListRetirableGrants with the addition of // the ability to pass a context and additional request options. // // See ListRetirableGrants for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ListRetirableGrantsWithContext(ctx aws.Context, input *ListRetirableGrantsInput, opts ...request.Option) (*ListGrantsResponse, error) { req, out := c.ListRetirableGrantsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } // ListRetirableGrantsPages iterates over the pages of a ListRetirableGrants operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // // See ListRetirableGrants method for more information on how to use this operation. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListRetirableGrants operation. // pageNum := 0 // err := client.ListRetirableGrantsPages(params, // func(page *kms.ListGrantsResponse, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) func (c *KMS) ListRetirableGrantsPages(input *ListRetirableGrantsInput, fn func(*ListGrantsResponse, bool) bool) error { return c.ListRetirableGrantsPagesWithContext(aws.BackgroundContext(), input, fn) } // ListRetirableGrantsPagesWithContext same as ListRetirableGrantsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ListRetirableGrantsPagesWithContext(ctx aws.Context, input *ListRetirableGrantsInput, fn func(*ListGrantsResponse, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { var inCpy *ListRetirableGrantsInput if input != nil { tmp := *input inCpy = &tmp } req, _ := c.ListRetirableGrantsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } for p.Next() { if !fn(p.Page().(*ListGrantsResponse), !p.HasNextPage()) { break } } return p.Err() } const opPutKeyPolicy = "PutKeyPolicy" // PutKeyPolicyRequest generates a "aws/request.Request" representing the // client's request for the PutKeyPolicy operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See PutKeyPolicy for more information on using the PutKeyPolicy // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the PutKeyPolicyRequest method. // req, resp := client.PutKeyPolicyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) PutKeyPolicyRequest(input *PutKeyPolicyInput) (req *request.Request, output *PutKeyPolicyOutput) { op := &request.Operation{ Name: opPutKeyPolicy, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &PutKeyPolicyInput{} } output = &PutKeyPolicyOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // PutKeyPolicy API operation for AWS Key Management Service. // // Attaches a key policy to the specified KMS key. // // For more information about key policies, see Key Policies (path_to_url // in the Key Management Service Developer Guide. For help writing and formatting // a JSON policy document, see the IAM JSON Policy Reference (path_to_url // in the Identity and Access Management User Guide . For examples of adding // a key policy in multiple programming languages, see Setting a key policy // (path_to_url#put-policy) // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:PutKeyPolicy (path_to_url // (key policy) // // Related operations: GetKeyPolicy // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation PutKeyPolicy for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - MalformedPolicyDocumentException // The request was rejected because the specified policy is not syntactically // or semantically correct. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - LimitExceededException // The request was rejected because a quota was exceeded. For more information, // see Quotas (path_to_url // in the Key Management Service Developer Guide. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // See also, path_to_url func (c *KMS) PutKeyPolicy(input *PutKeyPolicyInput) (*PutKeyPolicyOutput, error) { req, out := c.PutKeyPolicyRequest(input) return out, req.Send() } // PutKeyPolicyWithContext is the same as PutKeyPolicy with the addition of // the ability to pass a context and additional request options. // // See PutKeyPolicy for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) PutKeyPolicyWithContext(ctx aws.Context, input *PutKeyPolicyInput, opts ...request.Option) (*PutKeyPolicyOutput, error) { req, out := c.PutKeyPolicyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opReEncrypt = "ReEncrypt" // ReEncryptRequest generates a "aws/request.Request" representing the // client's request for the ReEncrypt operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See ReEncrypt for more information on using the ReEncrypt // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the ReEncryptRequest method. // req, resp := client.ReEncryptRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) ReEncryptRequest(input *ReEncryptInput) (req *request.Request, output *ReEncryptOutput) { op := &request.Operation{ Name: opReEncrypt, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &ReEncryptInput{} } output = &ReEncryptOutput{} req = c.newRequest(op, input, output) return } // ReEncrypt API operation for AWS Key Management Service. // // Decrypts ciphertext and then reencrypts it entirely within KMS. You can use // this operation to change the KMS key under which data is encrypted, such // as when you manually rotate (path_to_url#rotate-keys-manually) // a KMS key or change the KMS key that protects a ciphertext. You can also // use it to reencrypt ciphertext under the same KMS key, such as to change // the encryption context (path_to_url#encrypt_context) // of a ciphertext. // // The ReEncrypt operation can decrypt ciphertext that was encrypted by using // a KMS key in an KMS operation, such as Encrypt or GenerateDataKey. It can // also decrypt ciphertext that was encrypted by using the public key of an // asymmetric KMS key (path_to_url#asymmetric-cmks) // outside of KMS. However, it cannot decrypt ciphertext produced by other libraries, // such as the Amazon Web Services Encryption SDK (path_to_url // or Amazon S3 client-side encryption (path_to_url // These libraries return a ciphertext format that is incompatible with KMS. // // When you use the ReEncrypt operation, you need to provide information for // the decrypt operation and the subsequent encrypt operation. // // - If your ciphertext was encrypted under an asymmetric KMS key, you must // use the SourceKeyId parameter to identify the KMS key that encrypted the // ciphertext. You must also supply the encryption algorithm that was used. // This information is required to decrypt the data. // // - If your ciphertext was encrypted under a symmetric encryption KMS key, // the SourceKeyId parameter is optional. KMS can get this information from // metadata that it adds to the symmetric ciphertext blob. This feature adds // durability to your implementation by ensuring that authorized users can // decrypt ciphertext decades after it was encrypted, even if they've lost // track of the key ID. However, specifying the source KMS key is always // recommended as a best practice. When you use the SourceKeyId parameter // to specify a KMS key, KMS uses only the KMS key you specify. If the ciphertext // was encrypted under a different KMS key, the ReEncrypt operation fails. // This practice ensures that you use the KMS key that you intend. // // - To reencrypt the data, you must use the DestinationKeyId parameter to // specify the KMS key that re-encrypts the data after it is decrypted. If // the destination KMS key is an asymmetric KMS key, you must also provide // the encryption algorithm. The algorithm that you choose must be compatible // with the KMS key. When you use an asymmetric KMS key to encrypt or reencrypt // data, be sure to record the KMS key and encryption algorithm that you // choose. You will be required to provide the same KMS key and encryption // algorithm when you decrypt the data. If the KMS key and algorithm do not // match the values used to encrypt the data, the decrypt operation fails. // You are not required to supply the key ID and encryption algorithm when // you decrypt with symmetric encryption KMS keys because KMS stores this // information in the ciphertext blob. KMS cannot store metadata in ciphertext // generated with asymmetric keys. The standard format for asymmetric key // ciphertext does not include configurable fields. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: Yes. The source KMS key and destination KMS key can be // in different Amazon Web Services accounts. Either or both KMS keys can be // in a different account than the caller. To specify a KMS key in a different // account, you must use its key ARN or alias ARN. // // Required permissions: // // - kms:ReEncryptFrom (path_to_url // permission on the source KMS key (key policy) // // - kms:ReEncryptTo (path_to_url // permission on the destination KMS key (key policy) // // To permit reencryption from or to a KMS key, include the "kms:ReEncrypt*" // permission in your key policy (path_to_url // This permission is automatically included in the key policy when you use // the console to create a KMS key. But you must include it manually when you // create a KMS key programmatically or when you use the PutKeyPolicy operation // to set a key policy. // // Related operations: // // - Decrypt // // - Encrypt // // - GenerateDataKey // // - GenerateDataKeyPair // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation ReEncrypt for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - InvalidCiphertextException // From the Decrypt or ReEncrypt operation, the request was rejected because // the specified ciphertext, or additional authenticated data incorporated into // the ciphertext, such as the encryption context, is corrupted, missing, or // otherwise invalid. // // From the ImportKeyMaterial operation, the request was rejected because KMS // could not decrypt the encrypted (wrapped) key material. // // - KeyUnavailableException // The request was rejected because the specified KMS key was not available. // You can retry the request. // // - IncorrectKeyException // The request was rejected because the specified KMS key cannot decrypt the // data. The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request // must identify the same KMS key that was used to encrypt the ciphertext. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InvalidKeyUsageException // The request was rejected for one of the following reasons: // // - The KeyUsage value of the KMS key is incompatible with the API operation. // // - The encryption algorithm or signing algorithm specified for the operation // is incompatible with the type of key material in the KMS key (KeySpec). // // For encrypting, decrypting, re-encrypting, and generating data keys, the // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying messages, the // KeyUsage must be SIGN_VERIFY. For generating and verifying message authentication // codes (MACs), the KeyUsage must be GENERATE_VERIFY_MAC. To find the KeyUsage // of a KMS key, use the DescribeKey operation. // // To find the encryption or signing algorithms supported for a particular KMS // key, use the DescribeKey operation. // // - InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - DryRunOperationException // The request was rejected because the DryRun parameter was specified. // // See also, path_to_url func (c *KMS) ReEncrypt(input *ReEncryptInput) (*ReEncryptOutput, error) { req, out := c.ReEncryptRequest(input) return out, req.Send() } // ReEncryptWithContext is the same as ReEncrypt with the addition of // the ability to pass a context and additional request options. // // See ReEncrypt for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ReEncryptWithContext(ctx aws.Context, input *ReEncryptInput, opts ...request.Option) (*ReEncryptOutput, error) { req, out := c.ReEncryptRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opReplicateKey = "ReplicateKey" // ReplicateKeyRequest generates a "aws/request.Request" representing the // client's request for the ReplicateKey operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See ReplicateKey for more information on using the ReplicateKey // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the ReplicateKeyRequest method. // req, resp := client.ReplicateKeyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) ReplicateKeyRequest(input *ReplicateKeyInput) (req *request.Request, output *ReplicateKeyOutput) { op := &request.Operation{ Name: opReplicateKey, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &ReplicateKeyInput{} } output = &ReplicateKeyOutput{} req = c.newRequest(op, input, output) return } // ReplicateKey API operation for AWS Key Management Service. // // Replicates a multi-Region key into the specified Region. This operation creates // a multi-Region replica key based on a multi-Region primary key in a different // Region of the same Amazon Web Services partition. You can create multiple // replicas of a primary key, but each must be in a different Region. To create // a multi-Region primary key, use the CreateKey operation. // // This operation supports multi-Region keys, an KMS feature that lets you create // multiple interoperable KMS keys in different Amazon Web Services Regions. // Because these KMS keys have the same key ID, key material, and other metadata, // you can use them interchangeably to encrypt data in one Amazon Web Services // Region and decrypt it in a different Amazon Web Services Region without re-encrypting // the data or making a cross-Region call. For more information about multi-Region // keys, see Multi-Region keys in KMS (path_to_url // in the Key Management Service Developer Guide. // // A replica key is a fully-functional KMS key that can be used independently // of its primary and peer replica keys. A primary key and its replica keys // share properties that make them interoperable. They have the same key ID // (path_to_url#key-id-key-id) // and key material. They also have the same key spec (path_to_url#key-spec), // key usage (path_to_url#key-usage), // key material origin (path_to_url#key-origin), // and automatic key rotation status (path_to_url // KMS automatically synchronizes these shared properties among related multi-Region // keys. All other properties of a replica key can differ, including its key // policy (path_to_url // tags (path_to_url // aliases (path_to_url // and Key states of KMS keys (path_to_url // KMS pricing and quotas for KMS keys apply to each primary key and replica // key. // // When this operation completes, the new replica key has a transient key state // of Creating. This key state changes to Enabled (or PendingImport) after a // few seconds when the process of creating the new replica key is complete. // While the key state is Creating, you can manage key, but you cannot yet use // it in cryptographic operations. If you are creating and using the replica // key programmatically, retry on KMSInvalidStateException or call DescribeKey // to check its KeyState value before using it. For details about the Creating // key state, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // You cannot create more than one replica of a primary key in any Region. If // the Region already includes a replica of the key you're trying to replicate, // ReplicateKey returns an AlreadyExistsException error. If the key state of // the existing replica is PendingDeletion, you can cancel the scheduled key // deletion (CancelKeyDeletion) or wait for the key to be deleted. The new replica // key you create will have the same shared properties (path_to_url#mrk-sync-properties) // as the original replica key. // // The CloudTrail log of a ReplicateKey operation records a ReplicateKey operation // in the primary key's Region and a CreateKey operation in the replica key's // Region. // // If you replicate a multi-Region primary key with imported key material, the // replica key is created with no key material. You must import the same key // material that you imported into the primary key. For details, see Importing // key material into multi-Region keys (path_to_url // in the Key Management Service Developer Guide. // // To convert a replica key to a primary key, use the UpdatePrimaryRegion operation. // // ReplicateKey uses different default values for the KeyPolicy and Tags parameters // than those used in the KMS console. For details, see the parameter descriptions. // // Cross-account use: No. You cannot use this operation to create a replica // key in a different Amazon Web Services account. // // Required permissions: // // - kms:ReplicateKey on the primary key (in the primary key's Region). Include // this permission in the primary key's key policy. // // - kms:CreateKey in an IAM policy in the replica Region. // // - To use the Tags parameter, kms:TagResource in an IAM policy in the replica // Region. // // Related operations // // - CreateKey // // - UpdatePrimaryRegion // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation ReplicateKey for usage and error information. // // Returned Error Types: // // - AlreadyExistsException // The request was rejected because it attempted to create a resource that already // exists. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - LimitExceededException // The request was rejected because a quota was exceeded. For more information, // see Quotas (path_to_url // in the Key Management Service Developer Guide. // // - MalformedPolicyDocumentException // The request was rejected because the specified policy is not syntactically // or semantically correct. // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - TagException // The request was rejected because one or more tags are not valid. // // - UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // // See also, path_to_url func (c *KMS) ReplicateKey(input *ReplicateKeyInput) (*ReplicateKeyOutput, error) { req, out := c.ReplicateKeyRequest(input) return out, req.Send() } // ReplicateKeyWithContext is the same as ReplicateKey with the addition of // the ability to pass a context and additional request options. // // See ReplicateKey for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ReplicateKeyWithContext(ctx aws.Context, input *ReplicateKeyInput, opts ...request.Option) (*ReplicateKeyOutput, error) { req, out := c.ReplicateKeyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opRetireGrant = "RetireGrant" // RetireGrantRequest generates a "aws/request.Request" representing the // client's request for the RetireGrant operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See RetireGrant for more information on using the RetireGrant // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the RetireGrantRequest method. // req, resp := client.RetireGrantRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) RetireGrantRequest(input *RetireGrantInput) (req *request.Request, output *RetireGrantOutput) { op := &request.Operation{ Name: opRetireGrant, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &RetireGrantInput{} } output = &RetireGrantOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // RetireGrant API operation for AWS Key Management Service. // // Deletes a grant. Typically, you retire a grant when you no longer need its // permissions. To identify the grant to retire, use a grant token (path_to_url#grant_token), // or both the grant ID and a key identifier (key ID or key ARN) of the KMS // key. The CreateGrant operation returns both values. // // This operation can be called by the retiring principal for a grant, by the // grantee principal if the grant allows the RetireGrant operation, and by the // Amazon Web Services account in which the grant is created. It can also be // called by principals to whom permission for retiring a grant is delegated. // For details, see Retiring and revoking grants (path_to_url#grant-delete) // in the Key Management Service Developer Guide. // // For detailed information about grants, including grant terminology, see Grants // in KMS (path_to_url // in the Key Management Service Developer Guide . For examples of working with // grants in several programming languages, see Programming grants (path_to_url // // Cross-account use: Yes. You can retire a grant on a KMS key in a different // Amazon Web Services account. // // Required permissions: Permission to retire a grant is determined primarily // by the grant. For details, see Retiring and revoking grants (path_to_url#grant-delete) // in the Key Management Service Developer Guide. // // Related operations: // // - CreateGrant // // - ListGrants // // - ListRetirableGrants // // - RevokeGrant // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation RetireGrant for usage and error information. // // Returned Error Types: // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // // - InvalidGrantIdException // The request was rejected because the specified GrantId is not valid. // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - DryRunOperationException // The request was rejected because the DryRun parameter was specified. // // See also, path_to_url func (c *KMS) RetireGrant(input *RetireGrantInput) (*RetireGrantOutput, error) { req, out := c.RetireGrantRequest(input) return out, req.Send() } // RetireGrantWithContext is the same as RetireGrant with the addition of // the ability to pass a context and additional request options. // // See RetireGrant for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) RetireGrantWithContext(ctx aws.Context, input *RetireGrantInput, opts ...request.Option) (*RetireGrantOutput, error) { req, out := c.RetireGrantRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opRevokeGrant = "RevokeGrant" // RevokeGrantRequest generates a "aws/request.Request" representing the // client's request for the RevokeGrant operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See RevokeGrant for more information on using the RevokeGrant // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the RevokeGrantRequest method. // req, resp := client.RevokeGrantRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) RevokeGrantRequest(input *RevokeGrantInput) (req *request.Request, output *RevokeGrantOutput) { op := &request.Operation{ Name: opRevokeGrant, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &RevokeGrantInput{} } output = &RevokeGrantOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // RevokeGrant API operation for AWS Key Management Service. // // Deletes the specified grant. You revoke a grant to terminate the permissions // that the grant allows. For more information, see Retiring and revoking grants // (path_to_url#grant-delete) // in the Key Management Service Developer Guide . // // When you create, retire, or revoke a grant, there might be a brief delay, // usually less than five minutes, until the grant is available throughout KMS. // This state is known as eventual consistency. For details, see Eventual consistency // (path_to_url#terms-eventual-consistency) // in the Key Management Service Developer Guide . // // For detailed information about grants, including grant terminology, see Grants // in KMS (path_to_url // in the Key Management Service Developer Guide . For examples of working with // grants in several programming languages, see Programming grants (path_to_url // // Cross-account use: Yes. To perform this operation on a KMS key in a different // Amazon Web Services account, specify the key ARN in the value of the KeyId // parameter. // // Required permissions: kms:RevokeGrant (path_to_url // (key policy). // // Related operations: // // - CreateGrant // // - ListGrants // // - ListRetirableGrants // // - RetireGrant // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation RevokeGrant for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - InvalidGrantIdException // The request was rejected because the specified GrantId is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - DryRunOperationException // The request was rejected because the DryRun parameter was specified. // // See also, path_to_url func (c *KMS) RevokeGrant(input *RevokeGrantInput) (*RevokeGrantOutput, error) { req, out := c.RevokeGrantRequest(input) return out, req.Send() } // RevokeGrantWithContext is the same as RevokeGrant with the addition of // the ability to pass a context and additional request options. // // See RevokeGrant for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) RevokeGrantWithContext(ctx aws.Context, input *RevokeGrantInput, opts ...request.Option) (*RevokeGrantOutput, error) { req, out := c.RevokeGrantRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opScheduleKeyDeletion = "ScheduleKeyDeletion" // ScheduleKeyDeletionRequest generates a "aws/request.Request" representing the // client's request for the ScheduleKeyDeletion operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See ScheduleKeyDeletion for more information on using the ScheduleKeyDeletion // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the ScheduleKeyDeletionRequest method. // req, resp := client.ScheduleKeyDeletionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) ScheduleKeyDeletionRequest(input *ScheduleKeyDeletionInput) (req *request.Request, output *ScheduleKeyDeletionOutput) { op := &request.Operation{ Name: opScheduleKeyDeletion, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &ScheduleKeyDeletionInput{} } output = &ScheduleKeyDeletionOutput{} req = c.newRequest(op, input, output) return } // ScheduleKeyDeletion API operation for AWS Key Management Service. // // Schedules the deletion of a KMS key. By default, KMS applies a waiting period // of 30 days, but you can specify a waiting period of 7-30 days. When this // operation is successful, the key state of the KMS key changes to PendingDeletion // and the key can't be used in any cryptographic operations. It remains in // this state for the duration of the waiting period. Before the waiting period // ends, you can use CancelKeyDeletion to cancel the deletion of the KMS key. // After the waiting period ends, KMS deletes the KMS key, its key material, // and all KMS data associated with it, including all aliases that refer to // it. // // Deleting a KMS key is a destructive and potentially dangerous operation. // When a KMS key is deleted, all data that was encrypted under the KMS key // is unrecoverable. (The only exception is a multi-Region replica key (path_to_url // or an asymmetric or HMAC KMS key with imported key material (kms/latest/developerguide/importing-keys-managing.html#import-delete-key).) // To prevent the use of a KMS key without deleting it, use DisableKey. // // You can schedule the deletion of a multi-Region primary key and its replica // keys at any time. However, KMS will not delete a multi-Region primary key // with existing replica keys. If you schedule the deletion of a primary key // with replicas, its key state changes to PendingReplicaDeletion and it cannot // be replicated or used in cryptographic operations. This status can continue // indefinitely. When the last of its replicas keys is deleted (not just scheduled), // the key state of the primary key changes to PendingDeletion and its waiting // period (PendingWindowInDays) begins. For details, see Deleting multi-Region // keys (path_to_url // in the Key Management Service Developer Guide. // // When KMS deletes a KMS key from an CloudHSM key store (path_to_url // it makes a best effort to delete the associated key material from the associated // CloudHSM cluster. However, you might need to manually delete the orphaned // key material (path_to_url#fix-keystore-orphaned-key) // from the cluster and its backups. Deleting a KMS key from an external key // store (path_to_url // has no effect on the associated external key. However, for both types of // custom key stores, deleting a KMS key is destructive and irreversible. You // cannot decrypt ciphertext encrypted under the KMS key by using only its associated // external key or CloudHSM key. Also, you cannot recreate a KMS key in an external // key store by creating a new KMS key with the same key material. // // For more information about scheduling a KMS key for deletion, see Deleting // KMS keys (path_to_url // in the Key Management Service Developer Guide. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:ScheduleKeyDeletion (key policy) // // Related operations // // - CancelKeyDeletion // // - DisableKey // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation ScheduleKeyDeletion for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // See also, path_to_url func (c *KMS) ScheduleKeyDeletion(input *ScheduleKeyDeletionInput) (*ScheduleKeyDeletionOutput, error) { req, out := c.ScheduleKeyDeletionRequest(input) return out, req.Send() } // ScheduleKeyDeletionWithContext is the same as ScheduleKeyDeletion with the addition of // the ability to pass a context and additional request options. // // See ScheduleKeyDeletion for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) ScheduleKeyDeletionWithContext(ctx aws.Context, input *ScheduleKeyDeletionInput, opts ...request.Option) (*ScheduleKeyDeletionOutput, error) { req, out := c.ScheduleKeyDeletionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opSign = "Sign" // SignRequest generates a "aws/request.Request" representing the // client's request for the Sign operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See Sign for more information on using the Sign // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the SignRequest method. // req, resp := client.SignRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) SignRequest(input *SignInput) (req *request.Request, output *SignOutput) { op := &request.Operation{ Name: opSign, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &SignInput{} } output = &SignOutput{} req = c.newRequest(op, input, output) return } // Sign API operation for AWS Key Management Service. // // Creates a digital signature (path_to_url // for a message or message digest by using the private key in an asymmetric // signing KMS key. To verify the signature, use the Verify operation, or use // the public key in the same asymmetric KMS key outside of KMS. For information // about asymmetric KMS keys, see Asymmetric KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Digital signatures are generated and verified by using asymmetric key pair, // such as an RSA or ECC pair that is represented by an asymmetric KMS key. // The key owner (or an authorized user) uses their private key to sign a message. // Anyone with the public key can verify that the message was signed with that // particular private key and that the message hasn't changed since it was signed. // // To use the Sign operation, provide the following information: // // - Use the KeyId parameter to identify an asymmetric KMS key with a KeyUsage // value of SIGN_VERIFY. To get the KeyUsage value of a KMS key, use the // DescribeKey operation. The caller must have kms:Sign permission on the // KMS key. // // - Use the Message parameter to specify the message or message digest to // sign. You can submit messages of up to 4096 bytes. To sign a larger message, // generate a hash digest of the message, and then provide the hash digest // in the Message parameter. To indicate whether the message is a full message // or a digest, use the MessageType parameter. // // - Choose a signing algorithm that is compatible with the KMS key. // // When signing a message, be sure to record the KMS key and the signing algorithm. // This information is required to verify the signature. // // Best practices recommend that you limit the time during which any signature // is effective. This deters an attack where the actor uses a signed message // to establish validity repeatedly or long after the message is superseded. // Signatures do not include a timestamp, but you can include a timestamp in // the signed message to help you detect when its time to refresh the signature. // // To verify the signature that this operation generates, use the Verify operation. // Or use the GetPublicKey operation to download the public key and then use // the public key to verify the signature outside of KMS. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: Yes. To perform this operation with a KMS key in a different // Amazon Web Services account, specify the key ARN or alias ARN in the value // of the KeyId parameter. // // Required permissions: kms:Sign (path_to_url // (key policy) // // Related operations: Verify // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation Sign for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - KeyUnavailableException // The request was rejected because the specified KMS key was not available. // You can retry the request. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InvalidKeyUsageException // The request was rejected for one of the following reasons: // // - The KeyUsage value of the KMS key is incompatible with the API operation. // // - The encryption algorithm or signing algorithm specified for the operation // is incompatible with the type of key material in the KMS key (KeySpec). // // For encrypting, decrypting, re-encrypting, and generating data keys, the // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying messages, the // KeyUsage must be SIGN_VERIFY. For generating and verifying message authentication // codes (MACs), the KeyUsage must be GENERATE_VERIFY_MAC. To find the KeyUsage // of a KMS key, use the DescribeKey operation. // // To find the encryption or signing algorithms supported for a particular KMS // key, use the DescribeKey operation. // // - InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - DryRunOperationException // The request was rejected because the DryRun parameter was specified. // // See also, path_to_url func (c *KMS) Sign(input *SignInput) (*SignOutput, error) { req, out := c.SignRequest(input) return out, req.Send() } // SignWithContext is the same as Sign with the addition of // the ability to pass a context and additional request options. // // See Sign for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) SignWithContext(ctx aws.Context, input *SignInput, opts ...request.Option) (*SignOutput, error) { req, out := c.SignRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opTagResource = "TagResource" // TagResourceRequest generates a "aws/request.Request" representing the // client's request for the TagResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See TagResource for more information on using the TagResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the TagResourceRequest method. // req, resp := client.TagResourceRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { op := &request.Operation{ Name: opTagResource, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &TagResourceInput{} } output = &TagResourceOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // TagResource API operation for AWS Key Management Service. // // Adds or edits tags on a customer managed key (path_to_url#customer-cmk). // // Tagging or untagging a KMS key can allow or deny permission to the KMS key. // For details, see ABAC for KMS (path_to_url // in the Key Management Service Developer Guide. // // Each tag consists of a tag key and a tag value, both of which are case-sensitive // strings. The tag value can be an empty (null) string. To add a tag, specify // a new tag key and a tag value. To edit a tag, specify an existing tag key // and a new tag value. // // You can use this operation to tag a customer managed key (path_to_url#customer-cmk), // but you cannot tag an Amazon Web Services managed key (path_to_url#aws-managed-cmk), // an Amazon Web Services owned key (path_to_url#aws-owned-cmk), // a custom key store (path_to_url#keystore-concept), // or an alias (path_to_url#alias-concept). // // You can also add tags to a KMS key while creating it (CreateKey) or replicating // it (ReplicateKey). // // For information about using tags in KMS, see Tagging keys (path_to_url // For general information about tags, including the format and syntax, see // Tagging Amazon Web Services resources (path_to_url // in the Amazon Web Services General Reference. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:TagResource (path_to_url // (key policy) // // Related operations // // - CreateKey // // - ListResourceTags // // - ReplicateKey // // - UntagResource // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation TagResource for usage and error information. // // Returned Error Types: // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - LimitExceededException // The request was rejected because a quota was exceeded. For more information, // see Quotas (path_to_url // in the Key Management Service Developer Guide. // // - TagException // The request was rejected because one or more tags are not valid. // // See also, path_to_url func (c *KMS) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { req, out := c.TagResourceRequest(input) return out, req.Send() } // TagResourceWithContext is the same as TagResource with the addition of // the ability to pass a context and additional request options. // // See TagResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { req, out := c.TagResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opUntagResource = "UntagResource" // UntagResourceRequest generates a "aws/request.Request" representing the // client's request for the UntagResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See UntagResource for more information on using the UntagResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the UntagResourceRequest method. // req, resp := client.UntagResourceRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { op := &request.Operation{ Name: opUntagResource, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &UntagResourceInput{} } output = &UntagResourceOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // UntagResource API operation for AWS Key Management Service. // // Deletes tags from a customer managed key (path_to_url#customer-cmk). // To delete a tag, specify the tag key and the KMS key. // // Tagging or untagging a KMS key can allow or deny permission to the KMS key. // For details, see ABAC for KMS (path_to_url // in the Key Management Service Developer Guide. // // When it succeeds, the UntagResource operation doesn't return any output. // Also, if the specified tag key isn't found on the KMS key, it doesn't throw // an exception or return a response. To confirm that the operation worked, // use the ListResourceTags operation. // // For information about using tags in KMS, see Tagging keys (path_to_url // For general information about tags, including the format and syntax, see // Tagging Amazon Web Services resources (path_to_url // in the Amazon Web Services General Reference. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:UntagResource (path_to_url // (key policy) // // Related operations // // - CreateKey // // - ListResourceTags // // - ReplicateKey // // - TagResource // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation UntagResource for usage and error information. // // Returned Error Types: // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - TagException // The request was rejected because one or more tags are not valid. // // See also, path_to_url func (c *KMS) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { req, out := c.UntagResourceRequest(input) return out, req.Send() } // UntagResourceWithContext is the same as UntagResource with the addition of // the ability to pass a context and additional request options. // // See UntagResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { req, out := c.UntagResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opUpdateAlias = "UpdateAlias" // UpdateAliasRequest generates a "aws/request.Request" representing the // client's request for the UpdateAlias operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See UpdateAlias for more information on using the UpdateAlias // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the UpdateAliasRequest method. // req, resp := client.UpdateAliasRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, output *UpdateAliasOutput) { op := &request.Operation{ Name: opUpdateAlias, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &UpdateAliasInput{} } output = &UpdateAliasOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // UpdateAlias API operation for AWS Key Management Service. // // Associates an existing KMS alias with a different KMS key. Each alias is // associated with only one KMS key at a time, although a KMS key can have multiple // aliases. The alias and the KMS key must be in the same Amazon Web Services // account and Region. // // Adding, deleting, or updating an alias can allow or deny permission to the // KMS key. For details, see ABAC for KMS (path_to_url // in the Key Management Service Developer Guide. // // The current and new KMS key must be the same type (both symmetric or both // asymmetric or both HMAC), and they must have the same key usage. This restriction // prevents errors in code that uses aliases. If you must assign an alias to // a different type of KMS key, use DeleteAlias to delete the old alias and // CreateAlias to create a new alias. // // You cannot use UpdateAlias to change an alias name. To change an alias name, // use DeleteAlias to delete the old alias and CreateAlias to create a new alias. // // Because an alias is not a property of a KMS key, you can create, update, // and delete the aliases of a KMS key without affecting the KMS key. Also, // aliases do not appear in the response from the DescribeKey operation. To // get the aliases of all KMS keys in the account, use the ListAliases operation. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions // // - kms:UpdateAlias (path_to_url // on the alias (IAM policy). // // - kms:UpdateAlias (path_to_url // on the current KMS key (key policy). // // - kms:UpdateAlias (path_to_url // on the new KMS key (key policy). // // For details, see Controlling access to aliases (path_to_url#alias-access) // in the Key Management Service Developer Guide. // // Related operations: // // - CreateAlias // // - DeleteAlias // // - ListAliases // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation UpdateAlias for usage and error information. // // Returned Error Types: // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - LimitExceededException // The request was rejected because a quota was exceeded. For more information, // see Quotas (path_to_url // in the Key Management Service Developer Guide. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // See also, path_to_url func (c *KMS) UpdateAlias(input *UpdateAliasInput) (*UpdateAliasOutput, error) { req, out := c.UpdateAliasRequest(input) return out, req.Send() } // UpdateAliasWithContext is the same as UpdateAlias with the addition of // the ability to pass a context and additional request options. // // See UpdateAlias for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) UpdateAliasWithContext(ctx aws.Context, input *UpdateAliasInput, opts ...request.Option) (*UpdateAliasOutput, error) { req, out := c.UpdateAliasRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opUpdateCustomKeyStore = "UpdateCustomKeyStore" // UpdateCustomKeyStoreRequest generates a "aws/request.Request" representing the // client's request for the UpdateCustomKeyStore operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See UpdateCustomKeyStore for more information on using the UpdateCustomKeyStore // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the UpdateCustomKeyStoreRequest method. // req, resp := client.UpdateCustomKeyStoreRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) UpdateCustomKeyStoreRequest(input *UpdateCustomKeyStoreInput) (req *request.Request, output *UpdateCustomKeyStoreOutput) { op := &request.Operation{ Name: opUpdateCustomKeyStore, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &UpdateCustomKeyStoreInput{} } output = &UpdateCustomKeyStoreOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // UpdateCustomKeyStore API operation for AWS Key Management Service. // // Changes the properties of a custom key store. You can use this operation // to change the properties of an CloudHSM key store or an external key store. // // Use the required CustomKeyStoreId parameter to identify the custom key store. // Use the remaining optional parameters to change its properties. This operation // does not return any property values. To verify the updated property values, // use the DescribeCustomKeyStores operation. // // This operation is part of the custom key stores (path_to_url // feature in KMS, which combines the convenience and extensive integration // of KMS with the isolation and control of a key store that you own and manage. // // When updating the properties of an external key store, verify that the updated // settings connect your key store, via the external key store proxy, to the // same external key manager as the previous settings, or to a backup or snapshot // of the external key manager with the same cryptographic keys. If the updated // connection settings fail, you can fix them and retry, although an extended // delay might disrupt Amazon Web Services services. However, if KMS permanently // loses its access to cryptographic keys, ciphertext encrypted under those // keys is unrecoverable. // // For external key stores: // // Some external key managers provide a simpler method for updating an external // key store. For details, see your external key manager documentation. // // When updating an external key store in the KMS console, you can upload a // JSON-based proxy configuration file with the desired values. You cannot upload // the proxy configuration file to the UpdateCustomKeyStore operation. However, // you can use the file to help you determine the correct values for the UpdateCustomKeyStore // parameters. // // For an CloudHSM key store, you can use this operation to change the custom // key store friendly name (NewCustomKeyStoreName), to tell KMS about a change // to the kmsuser crypto user password (KeyStorePassword), or to associate the // custom key store with a different, but related, CloudHSM cluster (CloudHsmClusterId). // To update any property of an CloudHSM key store, the ConnectionState of the // CloudHSM key store must be DISCONNECTED. // // For an external key store, you can use this operation to change the custom // key store friendly name (NewCustomKeyStoreName), or to tell KMS about a change // to the external key store proxy authentication credentials (XksProxyAuthenticationCredential), // connection method (XksProxyConnectivity), external proxy endpoint (XksProxyUriEndpoint) // and path (XksProxyUriPath). For external key stores with an XksProxyConnectivity // of VPC_ENDPOINT_SERVICE, you can also update the Amazon VPC endpoint service // name (XksProxyVpcEndpointServiceName). To update most properties of an external // key store, the ConnectionState of the external key store must be DISCONNECTED. // However, you can update the CustomKeyStoreName, XksProxyAuthenticationCredential, // and XksProxyUriPath of an external key store when it is in the CONNECTED // or DISCONNECTED state. // // If your update requires a DISCONNECTED state, before using UpdateCustomKeyStore, // use the DisconnectCustomKeyStore operation to disconnect the custom key store. // After the UpdateCustomKeyStore operation completes, use the ConnectCustomKeyStore // to reconnect the custom key store. To find the ConnectionState of the custom // key store, use the DescribeCustomKeyStores operation. // // Before updating the custom key store, verify that the new values allow KMS // to connect the custom key store to its backing key store. For example, before // you change the XksProxyUriPath value, verify that the external key store // proxy is reachable at the new path. // // If the operation succeeds, it returns a JSON object with no properties. // // Cross-account use: No. You cannot perform this operation on a custom key // store in a different Amazon Web Services account. // // Required permissions: kms:UpdateCustomKeyStore (path_to_url // (IAM policy) // // Related operations: // // - ConnectCustomKeyStore // // - CreateCustomKeyStore // // - DeleteCustomKeyStore // // - DescribeCustomKeyStores // // - DisconnectCustomKeyStore // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation UpdateCustomKeyStore for usage and error information. // // Returned Error Types: // // - CustomKeyStoreNotFoundException // The request was rejected because KMS cannot find a custom key store with // the specified key store name or ID. // // - CustomKeyStoreNameInUseException // The request was rejected because the specified custom key store name is already // assigned to another custom key store in the account. Try again with a custom // key store name that is unique in the account. // // - CloudHsmClusterNotFoundException // The request was rejected because KMS cannot find the CloudHSM cluster with // the specified cluster ID. Retry the request with a different cluster ID. // // - CloudHsmClusterNotRelatedException // The request was rejected because the specified CloudHSM cluster has a different // cluster certificate than the original cluster. You cannot use the operation // to specify an unrelated cluster for an CloudHSM key store. // // Specify an CloudHSM cluster that shares a backup history with the original // cluster. This includes clusters that were created from a backup of the current // cluster, and clusters that were created from the same backup that produced // the current cluster. // // CloudHSM clusters that share a backup history have the same cluster certificate. // To view the cluster certificate of an CloudHSM cluster, use the DescribeClusters // (path_to_url // operation. // // - CustomKeyStoreInvalidStateException // The request was rejected because of the ConnectionState of the custom key // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores // operation. // // This exception is thrown under the following conditions: // // - You requested the ConnectCustomKeyStore operation on a custom key store // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid // for all other ConnectionState values. To reconnect a custom key store // in a FAILED state, disconnect it (DisconnectCustomKeyStore), then connect // it (ConnectCustomKeyStore). // // - You requested the CreateKey operation in a custom key store that is // not connected. This operations is valid only when the custom key store // ConnectionState is CONNECTED. // // - You requested the DisconnectCustomKeyStore operation on a custom key // store with a ConnectionState of DISCONNECTING or DISCONNECTED. This operation // is valid for all other ConnectionState values. // // - You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation // on a custom key store that is not disconnected. This operation is valid // only when the custom key store ConnectionState is DISCONNECTED. // // - You requested the GenerateRandom operation in an CloudHSM key store // that is not connected. This operation is valid only when the CloudHSM // key store ConnectionState is CONNECTED. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - CloudHsmClusterNotActiveException // The request was rejected because the CloudHSM cluster associated with the // CloudHSM key store is not active. Initialize and activate the cluster and // try the command again. For detailed instructions, see Getting Started (path_to_url // in the CloudHSM User Guide. // // - CloudHsmClusterInvalidConfigurationException // The request was rejected because the associated CloudHSM cluster did not // meet the configuration requirements for an CloudHSM key store. // // - The CloudHSM cluster must be configured with private subnets in at least // two different Availability Zones in the Region. // // - The security group for the cluster (path_to_url // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound // rules and the Destination in the outbound rules must match the security // group ID. These rules are set by default when you create the CloudHSM // cluster. Do not delete or change them. To get information about a particular // security group, use the DescribeSecurityGroups (path_to_url // operation. // // - The CloudHSM cluster must contain at least as many HSMs as the operation // requires. To add HSMs, use the CloudHSM CreateHsm (path_to_url // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey // operations, the CloudHSM cluster must have at least two active HSMs, each // in a different Availability Zone. For the ConnectCustomKeyStore operation, // the CloudHSM must contain at least one active HSM. // // For information about the requirements for an CloudHSM cluster that is associated // with an CloudHSM key store, see Assemble the Prerequisites (path_to_url#before-keystore) // in the Key Management Service Developer Guide. For information about creating // a private subnet for an CloudHSM cluster, see Create a Private Subnet (path_to_url // in the CloudHSM User Guide. For information about cluster security groups, // see Configure a Default Security Group (path_to_url // in the CloudHSM User Guide . // // - XksProxyUriInUseException // The request was rejected because the concatenation of the XksProxyUriEndpoint // and XksProxyUriPath is already associated with another external key store // in this Amazon Web Services Region. Each external key store in a Region must // use a unique external key store proxy API address. // // - XksProxyUriEndpointInUseException // The request was rejected because the XksProxyUriEndpoint is already associated // with another external key store in this Amazon Web Services Region. To identify // the cause, see the error message that accompanies the exception. // // - XksProxyUriUnreachableException // KMS was unable to reach the specified XksProxyUriPath. The path must be reachable // before you create the external key store or update its settings. // // This exception is also thrown when the external key store proxy response // to a GetHealthStatus request indicates that all external key manager instances // are unavailable. // // - XksProxyIncorrectAuthenticationCredentialException // The request was rejected because the proxy credentials failed to authenticate // to the specified external key store proxy. The specified external key store // proxy rejected a status request from KMS due to invalid credentials. This // can indicate an error in the credentials or in the identification of the // external key store proxy. // // - XksProxyVpcEndpointServiceInUseException // The request was rejected because the specified Amazon VPC endpoint service // is already associated with another external key store in this Amazon Web // Services Region. Each external key store in a Region must use a different // Amazon VPC endpoint service. // // - XksProxyVpcEndpointServiceNotFoundException // The request was rejected because KMS could not find the specified VPC endpoint // service. Use DescribeCustomKeyStores to verify the VPC endpoint service name // for the external key store. Also, confirm that the Allow principals list // for the VPC endpoint service includes the KMS service principal for the Region, // such as cks.kms.us-east-1.amazonaws.com. // // - XksProxyVpcEndpointServiceInvalidConfigurationException // The request was rejected because the Amazon VPC endpoint service configuration // does not fulfill the requirements for an external key store. To identify // the cause, see the error message that accompanies the exception and review // the requirements (path_to_url#xks-vpc-requirements) // for Amazon VPC endpoint service connectivity for an external key store. // // - XksProxyInvalidResponseException // KMS cannot interpret the response it received from the external key store // proxy. The problem might be a poorly constructed response, but it could also // be a transient network issue. If you see this error repeatedly, report it // to the proxy vendor. // // - XksProxyInvalidConfigurationException // The request was rejected because the external key store proxy is not configured // correctly. To identify the cause, see the error message that accompanies // the exception. // // See also, path_to_url func (c *KMS) UpdateCustomKeyStore(input *UpdateCustomKeyStoreInput) (*UpdateCustomKeyStoreOutput, error) { req, out := c.UpdateCustomKeyStoreRequest(input) return out, req.Send() } // UpdateCustomKeyStoreWithContext is the same as UpdateCustomKeyStore with the addition of // the ability to pass a context and additional request options. // // See UpdateCustomKeyStore for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) UpdateCustomKeyStoreWithContext(ctx aws.Context, input *UpdateCustomKeyStoreInput, opts ...request.Option) (*UpdateCustomKeyStoreOutput, error) { req, out := c.UpdateCustomKeyStoreRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opUpdateKeyDescription = "UpdateKeyDescription" // UpdateKeyDescriptionRequest generates a "aws/request.Request" representing the // client's request for the UpdateKeyDescription operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See UpdateKeyDescription for more information on using the UpdateKeyDescription // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the UpdateKeyDescriptionRequest method. // req, resp := client.UpdateKeyDescriptionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) UpdateKeyDescriptionRequest(input *UpdateKeyDescriptionInput) (req *request.Request, output *UpdateKeyDescriptionOutput) { op := &request.Operation{ Name: opUpdateKeyDescription, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &UpdateKeyDescriptionInput{} } output = &UpdateKeyDescriptionOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // UpdateKeyDescription API operation for AWS Key Management Service. // // Updates the description of a KMS key. To see the description of a KMS key, // use DescribeKey. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: No. You cannot perform this operation on a KMS key in // a different Amazon Web Services account. // // Required permissions: kms:UpdateKeyDescription (path_to_url // (key policy) // // Related operations // // - CreateKey // // - DescribeKey // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation UpdateKeyDescription for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // See also, path_to_url func (c *KMS) UpdateKeyDescription(input *UpdateKeyDescriptionInput) (*UpdateKeyDescriptionOutput, error) { req, out := c.UpdateKeyDescriptionRequest(input) return out, req.Send() } // UpdateKeyDescriptionWithContext is the same as UpdateKeyDescription with the addition of // the ability to pass a context and additional request options. // // See UpdateKeyDescription for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) UpdateKeyDescriptionWithContext(ctx aws.Context, input *UpdateKeyDescriptionInput, opts ...request.Option) (*UpdateKeyDescriptionOutput, error) { req, out := c.UpdateKeyDescriptionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opUpdatePrimaryRegion = "UpdatePrimaryRegion" // UpdatePrimaryRegionRequest generates a "aws/request.Request" representing the // client's request for the UpdatePrimaryRegion operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See UpdatePrimaryRegion for more information on using the UpdatePrimaryRegion // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the UpdatePrimaryRegionRequest method. // req, resp := client.UpdatePrimaryRegionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) UpdatePrimaryRegionRequest(input *UpdatePrimaryRegionInput) (req *request.Request, output *UpdatePrimaryRegionOutput) { op := &request.Operation{ Name: opUpdatePrimaryRegion, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &UpdatePrimaryRegionInput{} } output = &UpdatePrimaryRegionOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } // UpdatePrimaryRegion API operation for AWS Key Management Service. // // Changes the primary key of a multi-Region key. // // This operation changes the replica key in the specified Region to a primary // key and changes the former primary key to a replica key. For example, suppose // you have a primary key in us-east-1 and a replica key in eu-west-2. If you // run UpdatePrimaryRegion with a PrimaryRegion value of eu-west-2, the primary // key is now the key in eu-west-2, and the key in us-east-1 becomes a replica // key. For details, see Updating the primary Region (path_to_url#multi-region-update) // in the Key Management Service Developer Guide. // // This operation supports multi-Region keys, an KMS feature that lets you create // multiple interoperable KMS keys in different Amazon Web Services Regions. // Because these KMS keys have the same key ID, key material, and other metadata, // you can use them interchangeably to encrypt data in one Amazon Web Services // Region and decrypt it in a different Amazon Web Services Region without re-encrypting // the data or making a cross-Region call. For more information about multi-Region // keys, see Multi-Region keys in KMS (path_to_url // in the Key Management Service Developer Guide. // // The primary key of a multi-Region key is the source for properties that are // always shared by primary and replica keys, including the key material, key // ID (path_to_url#key-id-key-id), // key spec (path_to_url#key-spec), // key usage (path_to_url#key-usage), // key material origin (path_to_url#key-origin), // and automatic key rotation (path_to_url // It's the only key that can be replicated. You cannot delete the primary key // (path_to_url // until all replica keys are deleted. // // The key ID and primary Region that you specify uniquely identify the replica // key that will become the primary key. The primary Region must already have // a replica key. This operation does not create a KMS key in the specified // Region. To find the replica keys, use the DescribeKey operation on the primary // key or any replica key. To create a replica key, use the ReplicateKey operation. // // You can run this operation while using the affected multi-Region keys in // cryptographic operations. This operation should not delay, interrupt, or // cause failures in cryptographic operations. // // Even after this operation completes, the process of updating the primary // Region might still be in progress for a few more seconds. Operations such // as DescribeKey might display both the old and new primary keys as replicas. // The old and new primary keys have a transient key state of Updating. The // original key state is restored when the update is complete. While the key // state is Updating, you can use the keys in cryptographic operations, but // you cannot replicate the new primary key or perform certain management operations, // such as enabling or disabling these keys. For details about the Updating // key state, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // This operation does not return any output. To verify that primary key is // changed, use the DescribeKey operation. // // Cross-account use: No. You cannot use this operation in a different Amazon // Web Services account. // // Required permissions: // // - kms:UpdatePrimaryRegion on the current primary key (in the primary key's // Region). Include this permission primary key's key policy. // // - kms:UpdatePrimaryRegion on the current replica key (in the replica key's // Region). Include this permission in the replica key's key policy. // // Related operations // // - CreateKey // // - ReplicateKey // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation UpdatePrimaryRegion for usage and error information. // // Returned Error Types: // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // // See also, path_to_url func (c *KMS) UpdatePrimaryRegion(input *UpdatePrimaryRegionInput) (*UpdatePrimaryRegionOutput, error) { req, out := c.UpdatePrimaryRegionRequest(input) return out, req.Send() } // UpdatePrimaryRegionWithContext is the same as UpdatePrimaryRegion with the addition of // the ability to pass a context and additional request options. // // See UpdatePrimaryRegion for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) UpdatePrimaryRegionWithContext(ctx aws.Context, input *UpdatePrimaryRegionInput, opts ...request.Option) (*UpdatePrimaryRegionOutput, error) { req, out := c.UpdatePrimaryRegionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opVerify = "Verify" // VerifyRequest generates a "aws/request.Request" representing the // client's request for the Verify operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See Verify for more information on using the Verify // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the VerifyRequest method. // req, resp := client.VerifyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) VerifyRequest(input *VerifyInput) (req *request.Request, output *VerifyOutput) { op := &request.Operation{ Name: opVerify, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &VerifyInput{} } output = &VerifyOutput{} req = c.newRequest(op, input, output) return } // Verify API operation for AWS Key Management Service. // // Verifies a digital signature that was generated by the Sign operation. // // Verification confirms that an authorized user signed the message with the // specified KMS key and signing algorithm, and the message hasn't changed since // it was signed. If the signature is verified, the value of the SignatureValid // field in the response is True. If the signature verification fails, the Verify // operation fails with an KMSInvalidSignatureException exception. // // A digital signature is generated by using the private key in an asymmetric // KMS key. The signature is verified by using the public key in the same asymmetric // KMS key. For information about asymmetric KMS keys, see Asymmetric KMS keys // (path_to_url // in the Key Management Service Developer Guide. // // To use the Verify operation, specify the same asymmetric KMS key, message, // and signing algorithm that were used to produce the signature. The message // type does not need to be the same as the one used for signing, but it must // indicate whether the value of the Message parameter should be hashed as part // of the verification process. // // You can also verify the digital signature by using the public key of the // KMS key outside of KMS. Use the GetPublicKey operation to download the public // key in the asymmetric KMS key and then use the public key to verify the signature // outside of KMS. The advantage of using the Verify operation is that it is // performed within KMS. As a result, it's easy to call, the operation is performed // within the FIPS boundary, it is logged in CloudTrail, and you can use key // policy and IAM policy to determine who is authorized to use the KMS key to // verify signatures. // // To verify a signature outside of KMS with an SM2 public key (China Regions // only), you must specify the distinguishing ID. By default, KMS uses 1234567812345678 // as the distinguishing ID. For more information, see Offline verification // with SM2 key pairs (path_to_url#key-spec-sm-offline-verification). // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: Yes. To perform this operation with a KMS key in a different // Amazon Web Services account, specify the key ARN or alias ARN in the value // of the KeyId parameter. // // Required permissions: kms:Verify (path_to_url // (key policy) // // Related operations: Sign // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation Verify for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - KeyUnavailableException // The request was rejected because the specified KMS key was not available. // You can retry the request. // // - DependencyTimeoutException // The system timed out while trying to fulfill the request. You can retry the // request. // // - InvalidKeyUsageException // The request was rejected for one of the following reasons: // // - The KeyUsage value of the KMS key is incompatible with the API operation. // // - The encryption algorithm or signing algorithm specified for the operation // is incompatible with the type of key material in the KMS key (KeySpec). // // For encrypting, decrypting, re-encrypting, and generating data keys, the // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying messages, the // KeyUsage must be SIGN_VERIFY. For generating and verifying message authentication // codes (MACs), the KeyUsage must be GENERATE_VERIFY_MAC. To find the KeyUsage // of a KMS key, use the DescribeKey operation. // // To find the encryption or signing algorithms supported for a particular KMS // key, use the DescribeKey operation. // // - InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - KMSInvalidSignatureException // The request was rejected because the signature verification failed. Signature // verification fails when it cannot confirm that signature was produced by // signing the specified message with the specified KMS key and signing algorithm. // // - DryRunOperationException // The request was rejected because the DryRun parameter was specified. // // See also, path_to_url func (c *KMS) Verify(input *VerifyInput) (*VerifyOutput, error) { req, out := c.VerifyRequest(input) return out, req.Send() } // VerifyWithContext is the same as Verify with the addition of // the ability to pass a context and additional request options. // // See Verify for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) VerifyWithContext(ctx aws.Context, input *VerifyInput, opts ...request.Option) (*VerifyOutput, error) { req, out := c.VerifyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opVerifyMac = "VerifyMac" // VerifyMacRequest generates a "aws/request.Request" representing the // client's request for the VerifyMac operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See VerifyMac for more information on using the VerifyMac // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the VerifyMacRequest method. // req, resp := client.VerifyMacRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, path_to_url func (c *KMS) VerifyMacRequest(input *VerifyMacInput) (req *request.Request, output *VerifyMacOutput) { op := &request.Operation{ Name: opVerifyMac, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &VerifyMacInput{} } output = &VerifyMacOutput{} req = c.newRequest(op, input, output) return } // VerifyMac API operation for AWS Key Management Service. // // Verifies the hash-based message authentication code (HMAC) for a specified // message, HMAC KMS key, and MAC algorithm. To verify the HMAC, VerifyMac computes // an HMAC using the message, HMAC KMS key, and MAC algorithm that you specify, // and compares the computed HMAC to the HMAC that you specify. If the HMACs // are identical, the verification succeeds; otherwise, it fails. Verification // indicates that the message hasn't changed since the HMAC was calculated, // and the specified key was used to generate and verify the HMAC. // // HMAC KMS keys and the HMAC algorithms that KMS uses conform to industry standards // defined in RFC 2104 (path_to_url // // This operation is part of KMS support for HMAC KMS keys. For details, see // HMAC keys in KMS (path_to_url // in the Key Management Service Developer Guide. // // The KMS key that you use for this operation must be in a compatible key state. // For details, see Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. // // Cross-account use: Yes. To perform this operation with a KMS key in a different // Amazon Web Services account, specify the key ARN or alias ARN in the value // of the KeyId parameter. // // Required permissions: kms:VerifyMac (path_to_url // (key policy) // // Related operations: GenerateMac // // Eventual consistency: The KMS API follows an eventual consistency model. // For more information, see KMS eventual consistency (path_to_url // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Key Management Service's // API operation VerifyMac for usage and error information. // // Returned Error Types: // // - NotFoundException // The request was rejected because the specified entity or resource could not // be found. // // - DisabledException // The request was rejected because the specified KMS key is not enabled. // // - KeyUnavailableException // The request was rejected because the specified KMS key was not available. // You can retry the request. // // - InvalidKeyUsageException // The request was rejected for one of the following reasons: // // - The KeyUsage value of the KMS key is incompatible with the API operation. // // - The encryption algorithm or signing algorithm specified for the operation // is incompatible with the type of key material in the KMS key (KeySpec). // // For encrypting, decrypting, re-encrypting, and generating data keys, the // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying messages, the // KeyUsage must be SIGN_VERIFY. For generating and verifying message authentication // codes (MACs), the KeyUsage must be GENERATE_VERIFY_MAC. To find the KeyUsage // of a KMS key, use the DescribeKey operation. // // To find the encryption or signing algorithms supported for a particular KMS // key, use the DescribeKey operation. // // - InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // // - InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // // - KMSInvalidMacException // The request was rejected because the HMAC verification failed. HMAC verification // fails when the HMAC computed by using the specified message, HMAC KMS key, // and MAC algorithm does not match the HMAC specified in the request. // // - InvalidStateException // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. // // - DryRunOperationException // The request was rejected because the DryRun parameter was specified. // // See also, path_to_url func (c *KMS) VerifyMac(input *VerifyMacInput) (*VerifyMacOutput, error) { req, out := c.VerifyMacRequest(input) return out, req.Send() } // VerifyMacWithContext is the same as VerifyMac with the addition of // the ability to pass a context and additional request options. // // See VerifyMac for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See path_to_url // for more information on using Contexts. func (c *KMS) VerifyMacWithContext(ctx aws.Context, input *VerifyMacInput, opts ...request.Option) (*VerifyMacOutput, error) { req, out := c.VerifyMacRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } // Contains information about an alias. type AliasListEntry struct { _ struct{} `type:"structure"` // String that contains the key ARN. AliasArn *string `min:"20" type:"string"` // String that contains the alias. This value begins with alias/. AliasName *string `min:"1" type:"string"` // Date and time that the alias was most recently created in the account and // Region. Formatted as Unix time. CreationDate *time.Time `type:"timestamp"` // Date and time that the alias was most recently associated with a KMS key // in the account and Region. Formatted as Unix time. LastUpdatedDate *time.Time `type:"timestamp"` // String that contains the key identifier of the KMS key associated with the // alias. TargetKeyId *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s AliasListEntry) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s AliasListEntry) GoString() string { return s.String() } // SetAliasArn sets the AliasArn field's value. func (s *AliasListEntry) SetAliasArn(v string) *AliasListEntry { s.AliasArn = &v return s } // SetAliasName sets the AliasName field's value. func (s *AliasListEntry) SetAliasName(v string) *AliasListEntry { s.AliasName = &v return s } // SetCreationDate sets the CreationDate field's value. func (s *AliasListEntry) SetCreationDate(v time.Time) *AliasListEntry { s.CreationDate = &v return s } // SetLastUpdatedDate sets the LastUpdatedDate field's value. func (s *AliasListEntry) SetLastUpdatedDate(v time.Time) *AliasListEntry { s.LastUpdatedDate = &v return s } // SetTargetKeyId sets the TargetKeyId field's value. func (s *AliasListEntry) SetTargetKeyId(v string) *AliasListEntry { s.TargetKeyId = &v return s } // The request was rejected because it attempted to create a resource that already // exists. type AlreadyExistsException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s AlreadyExistsException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s AlreadyExistsException) GoString() string { return s.String() } func newErrorAlreadyExistsException(v protocol.ResponseMetadata) error { return &AlreadyExistsException{ RespMetadata: v, } } // Code returns the exception type name. func (s *AlreadyExistsException) Code() string { return "AlreadyExistsException" } // Message returns the exception's message. func (s *AlreadyExistsException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *AlreadyExistsException) OrigErr() error { return nil } func (s *AlreadyExistsException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *AlreadyExistsException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *AlreadyExistsException) RequestID() string { return s.RespMetadata.RequestID } type CancelKeyDeletionInput struct { _ struct{} `type:"structure"` // Identifies the KMS key whose deletion is being canceled. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CancelKeyDeletionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CancelKeyDeletionInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *CancelKeyDeletionInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "CancelKeyDeletionInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *CancelKeyDeletionInput) SetKeyId(v string) *CancelKeyDeletionInput { s.KeyId = &v return s } type CancelKeyDeletionOutput struct { _ struct{} `type:"structure"` // The Amazon Resource Name (key ARN (path_to_url#key-id-key-ARN)) // of the KMS key whose deletion is canceled. KeyId *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CancelKeyDeletionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CancelKeyDeletionOutput) GoString() string { return s.String() } // SetKeyId sets the KeyId field's value. func (s *CancelKeyDeletionOutput) SetKeyId(v string) *CancelKeyDeletionOutput { s.KeyId = &v return s } // The request was rejected because the specified CloudHSM cluster is already // associated with an CloudHSM key store in the account, or it shares a backup // history with an CloudHSM key store in the account. Each CloudHSM key store // in the account must be associated with a different CloudHSM cluster. // // CloudHSM clusters that share a backup history have the same cluster certificate. // To view the cluster certificate of an CloudHSM cluster, use the DescribeClusters // (path_to_url // operation. type CloudHsmClusterInUseException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CloudHsmClusterInUseException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CloudHsmClusterInUseException) GoString() string { return s.String() } func newErrorCloudHsmClusterInUseException(v protocol.ResponseMetadata) error { return &CloudHsmClusterInUseException{ RespMetadata: v, } } // Code returns the exception type name. func (s *CloudHsmClusterInUseException) Code() string { return "CloudHsmClusterInUseException" } // Message returns the exception's message. func (s *CloudHsmClusterInUseException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *CloudHsmClusterInUseException) OrigErr() error { return nil } func (s *CloudHsmClusterInUseException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *CloudHsmClusterInUseException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *CloudHsmClusterInUseException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the associated CloudHSM cluster did not // meet the configuration requirements for an CloudHSM key store. // // - The CloudHSM cluster must be configured with private subnets in at least // two different Availability Zones in the Region. // // - The security group for the cluster (path_to_url // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound // rules and the Destination in the outbound rules must match the security // group ID. These rules are set by default when you create the CloudHSM // cluster. Do not delete or change them. To get information about a particular // security group, use the DescribeSecurityGroups (path_to_url // operation. // // - The CloudHSM cluster must contain at least as many HSMs as the operation // requires. To add HSMs, use the CloudHSM CreateHsm (path_to_url // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey // operations, the CloudHSM cluster must have at least two active HSMs, each // in a different Availability Zone. For the ConnectCustomKeyStore operation, // the CloudHSM must contain at least one active HSM. // // For information about the requirements for an CloudHSM cluster that is associated // with an CloudHSM key store, see Assemble the Prerequisites (path_to_url#before-keystore) // in the Key Management Service Developer Guide. For information about creating // a private subnet for an CloudHSM cluster, see Create a Private Subnet (path_to_url // in the CloudHSM User Guide. For information about cluster security groups, // see Configure a Default Security Group (path_to_url // in the CloudHSM User Guide . type CloudHsmClusterInvalidConfigurationException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CloudHsmClusterInvalidConfigurationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CloudHsmClusterInvalidConfigurationException) GoString() string { return s.String() } func newErrorCloudHsmClusterInvalidConfigurationException(v protocol.ResponseMetadata) error { return &CloudHsmClusterInvalidConfigurationException{ RespMetadata: v, } } // Code returns the exception type name. func (s *CloudHsmClusterInvalidConfigurationException) Code() string { return "CloudHsmClusterInvalidConfigurationException" } // Message returns the exception's message. func (s *CloudHsmClusterInvalidConfigurationException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *CloudHsmClusterInvalidConfigurationException) OrigErr() error { return nil } func (s *CloudHsmClusterInvalidConfigurationException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *CloudHsmClusterInvalidConfigurationException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *CloudHsmClusterInvalidConfigurationException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the CloudHSM cluster associated with the // CloudHSM key store is not active. Initialize and activate the cluster and // try the command again. For detailed instructions, see Getting Started (path_to_url // in the CloudHSM User Guide. type CloudHsmClusterNotActiveException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CloudHsmClusterNotActiveException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CloudHsmClusterNotActiveException) GoString() string { return s.String() } func newErrorCloudHsmClusterNotActiveException(v protocol.ResponseMetadata) error { return &CloudHsmClusterNotActiveException{ RespMetadata: v, } } // Code returns the exception type name. func (s *CloudHsmClusterNotActiveException) Code() string { return "CloudHsmClusterNotActiveException" } // Message returns the exception's message. func (s *CloudHsmClusterNotActiveException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *CloudHsmClusterNotActiveException) OrigErr() error { return nil } func (s *CloudHsmClusterNotActiveException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *CloudHsmClusterNotActiveException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *CloudHsmClusterNotActiveException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because KMS cannot find the CloudHSM cluster with // the specified cluster ID. Retry the request with a different cluster ID. type CloudHsmClusterNotFoundException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CloudHsmClusterNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CloudHsmClusterNotFoundException) GoString() string { return s.String() } func newErrorCloudHsmClusterNotFoundException(v protocol.ResponseMetadata) error { return &CloudHsmClusterNotFoundException{ RespMetadata: v, } } // Code returns the exception type name. func (s *CloudHsmClusterNotFoundException) Code() string { return "CloudHsmClusterNotFoundException" } // Message returns the exception's message. func (s *CloudHsmClusterNotFoundException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *CloudHsmClusterNotFoundException) OrigErr() error { return nil } func (s *CloudHsmClusterNotFoundException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *CloudHsmClusterNotFoundException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *CloudHsmClusterNotFoundException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the specified CloudHSM cluster has a different // cluster certificate than the original cluster. You cannot use the operation // to specify an unrelated cluster for an CloudHSM key store. // // Specify an CloudHSM cluster that shares a backup history with the original // cluster. This includes clusters that were created from a backup of the current // cluster, and clusters that were created from the same backup that produced // the current cluster. // // CloudHSM clusters that share a backup history have the same cluster certificate. // To view the cluster certificate of an CloudHSM cluster, use the DescribeClusters // (path_to_url // operation. type CloudHsmClusterNotRelatedException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CloudHsmClusterNotRelatedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CloudHsmClusterNotRelatedException) GoString() string { return s.String() } func newErrorCloudHsmClusterNotRelatedException(v protocol.ResponseMetadata) error { return &CloudHsmClusterNotRelatedException{ RespMetadata: v, } } // Code returns the exception type name. func (s *CloudHsmClusterNotRelatedException) Code() string { return "CloudHsmClusterNotRelatedException" } // Message returns the exception's message. func (s *CloudHsmClusterNotRelatedException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *CloudHsmClusterNotRelatedException) OrigErr() error { return nil } func (s *CloudHsmClusterNotRelatedException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *CloudHsmClusterNotRelatedException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *CloudHsmClusterNotRelatedException) RequestID() string { return s.RespMetadata.RequestID } type ConnectCustomKeyStoreInput struct { _ struct{} `type:"structure"` // Enter the key store ID of the custom key store that you want to connect. // To find the ID of a custom key store, use the DescribeCustomKeyStores operation. // // CustomKeyStoreId is a required field CustomKeyStoreId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ConnectCustomKeyStoreInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ConnectCustomKeyStoreInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *ConnectCustomKeyStoreInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ConnectCustomKeyStoreInput"} if s.CustomKeyStoreId == nil { invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreId")) } if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. func (s *ConnectCustomKeyStoreInput) SetCustomKeyStoreId(v string) *ConnectCustomKeyStoreInput { s.CustomKeyStoreId = &v return s } type ConnectCustomKeyStoreOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ConnectCustomKeyStoreOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ConnectCustomKeyStoreOutput) GoString() string { return s.String() } type CreateAliasInput struct { _ struct{} `type:"structure"` // Specifies the alias name. This value must begin with alias/ followed by a // name, such as alias/ExampleAlias. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // The AliasName value must be string of 1-256 characters. It can contain only // alphanumeric characters, forward slashes (/), underscores (_), and dashes // (-). The alias name cannot begin with alias/aws/. The alias/aws/ prefix is // reserved for Amazon Web Services managed keys (path_to_url#aws-managed-cmk). // // AliasName is a required field AliasName *string `min:"1" type:"string" required:"true"` // Associates the alias with the specified customer managed key (path_to_url#customer-cmk). // The KMS key must be in the same Amazon Web Services Region. // // A valid key ID is required. If you supply a null or empty string value, this // operation returns an error. // // For help finding the key ID and ARN, see Finding the Key ID and ARN (path_to_url#find-cmk-id-arn) // in the Key Management Service Developer Guide . // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // TargetKeyId is a required field TargetKeyId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateAliasInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateAliasInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *CreateAliasInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "CreateAliasInput"} if s.AliasName == nil { invalidParams.Add(request.NewErrParamRequired("AliasName")) } if s.AliasName != nil && len(*s.AliasName) < 1 { invalidParams.Add(request.NewErrParamMinLen("AliasName", 1)) } if s.TargetKeyId == nil { invalidParams.Add(request.NewErrParamRequired("TargetKeyId")) } if s.TargetKeyId != nil && len(*s.TargetKeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("TargetKeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetAliasName sets the AliasName field's value. func (s *CreateAliasInput) SetAliasName(v string) *CreateAliasInput { s.AliasName = &v return s } // SetTargetKeyId sets the TargetKeyId field's value. func (s *CreateAliasInput) SetTargetKeyId(v string) *CreateAliasInput { s.TargetKeyId = &v return s } type CreateAliasOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateAliasOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateAliasOutput) GoString() string { return s.String() } type CreateCustomKeyStoreInput struct { _ struct{} `type:"structure"` // Identifies the CloudHSM cluster for an CloudHSM key store. This parameter // is required for custom key stores with CustomKeyStoreType of AWS_CLOUDHSM. // // Enter the cluster ID of any active CloudHSM cluster that is not already associated // with a custom key store. To find the cluster ID, use the DescribeClusters // (path_to_url // operation. CloudHsmClusterId *string `min:"19" type:"string"` // Specifies a friendly name for the custom key store. The name must be unique // in your Amazon Web Services account and Region. This parameter is required // for all custom key stores. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // CustomKeyStoreName is a required field CustomKeyStoreName *string `min:"1" type:"string" required:"true"` // Specifies the type of custom key store. The default value is AWS_CLOUDHSM. // // For a custom key store backed by an CloudHSM cluster, omit the parameter // or enter AWS_CLOUDHSM. For a custom key store backed by an external key manager // outside of Amazon Web Services, enter EXTERNAL_KEY_STORE. You cannot change // this property after the key store is created. CustomKeyStoreType *string `type:"string" enum:"CustomKeyStoreType"` // Specifies the kmsuser password for an CloudHSM key store. This parameter // is required for custom key stores with a CustomKeyStoreType of AWS_CLOUDHSM. // // Enter the password of the kmsuser crypto user (CU) account (path_to_url#concept-kmsuser) // in the specified CloudHSM cluster. KMS logs into the cluster as this user // to manage key material on your behalf. // // The password must be a string of 7 to 32 characters. Its value is case sensitive. // // This parameter tells KMS the kmsuser account password; it does not change // the password in the CloudHSM cluster. // // KeyStorePassword is a sensitive parameter and its value will be // replaced with "sensitive" in string returned by CreateCustomKeyStoreInput's // String and GoString methods. KeyStorePassword *string `min:"7" type:"string" sensitive:"true"` // Specifies the certificate for an CloudHSM key store. This parameter is required // for custom key stores with a CustomKeyStoreType of AWS_CLOUDHSM. // // Enter the content of the trust anchor certificate for the CloudHSM cluster. // This is the content of the customerCA.crt file that you created when you // initialized the cluster (path_to_url TrustAnchorCertificate *string `min:"1" type:"string"` // Specifies an authentication credential for the external key store proxy (XKS // proxy). This parameter is required for all custom key stores with a CustomKeyStoreType // of EXTERNAL_KEY_STORE. // // The XksProxyAuthenticationCredential has two required elements: RawSecretAccessKey, // a secret key, and AccessKeyId, a unique identifier for the RawSecretAccessKey. // For character requirements, see XksProxyAuthenticationCredentialType (kms/latest/APIReference/API_XksProxyAuthenticationCredentialType.html). // // KMS uses this authentication credential to sign requests to the external // key store proxy on your behalf. This credential is unrelated to Identity // and Access Management (IAM) and Amazon Web Services credentials. // // This parameter doesn't set or change the authentication credentials on the // XKS proxy. It just tells KMS the credential that you established on your // external key store proxy. If you rotate your proxy authentication credential, // use the UpdateCustomKeyStore operation to provide the new credential to KMS. XksProxyAuthenticationCredential *XksProxyAuthenticationCredentialType `type:"structure"` // Indicates how KMS communicates with the external key store proxy. This parameter // is required for custom key stores with a CustomKeyStoreType of EXTERNAL_KEY_STORE. // // If the external key store proxy uses a public endpoint, specify PUBLIC_ENDPOINT. // If the external key store proxy uses a Amazon VPC endpoint service for communication // with KMS, specify VPC_ENDPOINT_SERVICE. For help making this choice, see // Choosing a connectivity option (path_to_url#choose-xks-connectivity) // in the Key Management Service Developer Guide. // // An Amazon VPC endpoint service keeps your communication with KMS in a private // address space entirely within Amazon Web Services, but it requires more configuration, // including establishing a Amazon VPC with multiple subnets, a VPC endpoint // service, a network load balancer, and a verified private DNS name. A public // endpoint is simpler to set up, but it might be slower and might not fulfill // your security requirements. You might consider testing with a public endpoint, // and then establishing a VPC endpoint service for production tasks. Note that // this choice does not determine the location of the external key store proxy. // Even if you choose a VPC endpoint service, the proxy can be hosted within // the VPC or outside of Amazon Web Services such as in your corporate data // center. XksProxyConnectivity *string `type:"string" enum:"XksProxyConnectivityType"` // Specifies the endpoint that KMS uses to send requests to the external key // store proxy (XKS proxy). This parameter is required for custom key stores // with a CustomKeyStoreType of EXTERNAL_KEY_STORE. // // The protocol must be HTTPS. KMS communicates on port 443. Do not specify // the port in the XksProxyUriEndpoint value. // // For external key stores with XksProxyConnectivity value of VPC_ENDPOINT_SERVICE, // specify https:// followed by the private DNS name of the VPC endpoint service. // // For external key stores with PUBLIC_ENDPOINT connectivity, this endpoint // must be reachable before you create the custom key store. KMS connects to // the external key store proxy while creating the custom key store. For external // key stores with VPC_ENDPOINT_SERVICE connectivity, KMS connects when you // call the ConnectCustomKeyStore operation. // // The value of this parameter must begin with path_to_url The remainder can contain // upper and lower case letters (A-Z and a-z), numbers (0-9), dots (.), and // hyphens (-). Additional slashes (/ and \) are not permitted. // // Uniqueness requirements: // // * The combined XksProxyUriEndpoint and XksProxyUriPath values must be // unique in the Amazon Web Services account and Region. // // * An external key store with PUBLIC_ENDPOINT connectivity cannot use the // same XksProxyUriEndpoint value as an external key store with VPC_ENDPOINT_SERVICE // connectivity in this Amazon Web Services Region. // // * Each external key store with VPC_ENDPOINT_SERVICE connectivity must // have its own private DNS name. The XksProxyUriEndpoint value for external // key stores with VPC_ENDPOINT_SERVICE connectivity (private DNS name) must // be unique in the Amazon Web Services account and Region. XksProxyUriEndpoint *string `min:"10" type:"string"` // Specifies the base path to the proxy APIs for this external key store. To // find this value, see the documentation for your external key store proxy. // This parameter is required for all custom key stores with a CustomKeyStoreType // of EXTERNAL_KEY_STORE. // // The value must start with / and must end with /kms/xks/v1 where v1 represents // the version of the KMS external key store proxy API. This path can include // an optional prefix between the required elements such as /prefix/kms/xks/v1. // // Uniqueness requirements: // // * The combined XksProxyUriEndpoint and XksProxyUriPath values must be // unique in the Amazon Web Services account and Region. XksProxyUriPath *string `min:"10" type:"string"` // Specifies the name of the Amazon VPC endpoint service for interface endpoints // that is used to communicate with your external key store proxy (XKS proxy). // This parameter is required when the value of CustomKeyStoreType is EXTERNAL_KEY_STORE // and the value of XksProxyConnectivity is VPC_ENDPOINT_SERVICE. // // The Amazon VPC endpoint service must fulfill all requirements (path_to_url#xks-requirements) // for use with an external key store. // // Uniqueness requirements: // // * External key stores with VPC_ENDPOINT_SERVICE connectivity can share // an Amazon VPC, but each external key store must have its own VPC endpoint // service and private DNS name. XksProxyVpcEndpointServiceName *string `min:"20" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateCustomKeyStoreInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateCustomKeyStoreInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *CreateCustomKeyStoreInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "CreateCustomKeyStoreInput"} if s.CloudHsmClusterId != nil && len(*s.CloudHsmClusterId) < 19 { invalidParams.Add(request.NewErrParamMinLen("CloudHsmClusterId", 19)) } if s.CustomKeyStoreName == nil { invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreName")) } if s.CustomKeyStoreName != nil && len(*s.CustomKeyStoreName) < 1 { invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreName", 1)) } if s.KeyStorePassword != nil && len(*s.KeyStorePassword) < 7 { invalidParams.Add(request.NewErrParamMinLen("KeyStorePassword", 7)) } if s.TrustAnchorCertificate != nil && len(*s.TrustAnchorCertificate) < 1 { invalidParams.Add(request.NewErrParamMinLen("TrustAnchorCertificate", 1)) } if s.XksProxyUriEndpoint != nil && len(*s.XksProxyUriEndpoint) < 10 { invalidParams.Add(request.NewErrParamMinLen("XksProxyUriEndpoint", 10)) } if s.XksProxyUriPath != nil && len(*s.XksProxyUriPath) < 10 { invalidParams.Add(request.NewErrParamMinLen("XksProxyUriPath", 10)) } if s.XksProxyVpcEndpointServiceName != nil && len(*s.XksProxyVpcEndpointServiceName) < 20 { invalidParams.Add(request.NewErrParamMinLen("XksProxyVpcEndpointServiceName", 20)) } if s.XksProxyAuthenticationCredential != nil { if err := s.XksProxyAuthenticationCredential.Validate(); err != nil { invalidParams.AddNested("XksProxyAuthenticationCredential", err.(request.ErrInvalidParams)) } } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetCloudHsmClusterId sets the CloudHsmClusterId field's value. func (s *CreateCustomKeyStoreInput) SetCloudHsmClusterId(v string) *CreateCustomKeyStoreInput { s.CloudHsmClusterId = &v return s } // SetCustomKeyStoreName sets the CustomKeyStoreName field's value. func (s *CreateCustomKeyStoreInput) SetCustomKeyStoreName(v string) *CreateCustomKeyStoreInput { s.CustomKeyStoreName = &v return s } // SetCustomKeyStoreType sets the CustomKeyStoreType field's value. func (s *CreateCustomKeyStoreInput) SetCustomKeyStoreType(v string) *CreateCustomKeyStoreInput { s.CustomKeyStoreType = &v return s } // SetKeyStorePassword sets the KeyStorePassword field's value. func (s *CreateCustomKeyStoreInput) SetKeyStorePassword(v string) *CreateCustomKeyStoreInput { s.KeyStorePassword = &v return s } // SetTrustAnchorCertificate sets the TrustAnchorCertificate field's value. func (s *CreateCustomKeyStoreInput) SetTrustAnchorCertificate(v string) *CreateCustomKeyStoreInput { s.TrustAnchorCertificate = &v return s } // SetXksProxyAuthenticationCredential sets the XksProxyAuthenticationCredential field's value. func (s *CreateCustomKeyStoreInput) SetXksProxyAuthenticationCredential(v *XksProxyAuthenticationCredentialType) *CreateCustomKeyStoreInput { s.XksProxyAuthenticationCredential = v return s } // SetXksProxyConnectivity sets the XksProxyConnectivity field's value. func (s *CreateCustomKeyStoreInput) SetXksProxyConnectivity(v string) *CreateCustomKeyStoreInput { s.XksProxyConnectivity = &v return s } // SetXksProxyUriEndpoint sets the XksProxyUriEndpoint field's value. func (s *CreateCustomKeyStoreInput) SetXksProxyUriEndpoint(v string) *CreateCustomKeyStoreInput { s.XksProxyUriEndpoint = &v return s } // SetXksProxyUriPath sets the XksProxyUriPath field's value. func (s *CreateCustomKeyStoreInput) SetXksProxyUriPath(v string) *CreateCustomKeyStoreInput { s.XksProxyUriPath = &v return s } // SetXksProxyVpcEndpointServiceName sets the XksProxyVpcEndpointServiceName field's value. func (s *CreateCustomKeyStoreInput) SetXksProxyVpcEndpointServiceName(v string) *CreateCustomKeyStoreInput { s.XksProxyVpcEndpointServiceName = &v return s } type CreateCustomKeyStoreOutput struct { _ struct{} `type:"structure"` // A unique identifier for the new custom key store. CustomKeyStoreId *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateCustomKeyStoreOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateCustomKeyStoreOutput) GoString() string { return s.String() } // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. func (s *CreateCustomKeyStoreOutput) SetCustomKeyStoreId(v string) *CreateCustomKeyStoreOutput { s.CustomKeyStoreId = &v return s } type CreateGrantInput struct { _ struct{} `type:"structure"` // Specifies a grant constraint. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // KMS supports the EncryptionContextEquals and EncryptionContextSubset grant // constraints, which allow the permissions in the grant only when the encryption // context in the request matches (EncryptionContextEquals) or includes (EncryptionContextSubset) // the encryption context specified in the constraint. // // The encryption context grant constraints are supported only on grant operations // (path_to_url#terms-grant-operations) // that include an EncryptionContext parameter, such as cryptographic operations // on symmetric encryption KMS keys. Grants with grant constraints can include // the DescribeKey and RetireGrant operations, but the constraint doesn't apply // to these operations. If a grant with a grant constraint includes the CreateGrant // operation, the constraint requires that any grants created with the CreateGrant // permission have an equally strict or stricter encryption context constraint. // // You cannot use an encryption context grant constraint for cryptographic operations // with asymmetric KMS keys or HMAC KMS keys. Operations with these keys don't // support an encryption context. // // Each constraint value can include up to 8 encryption context pairs. The encryption // context value in each constraint cannot exceed 384 characters. For information // about grant constraints, see Using grant constraints (path_to_url#grant-constraints) // in the Key Management Service Developer Guide. For more information about // encryption context, see Encryption context (path_to_url#encrypt_context) // in the Key Management Service Developer Guide . Constraints *GrantConstraints `type:"structure"` // Checks if your request will succeed. DryRun is an optional parameter. // // To learn more about how to use this parameter, see Testing your KMS API calls // (path_to_url // in the Key Management Service Developer Guide. DryRun *bool `type:"boolean"` // A list of grant tokens. // // Use a grant token when your permission to call this operation comes from // a new grant that has not yet achieved eventual consistency. For more information, // see Grant token (path_to_url#grant_token) // and Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // The identity that gets the permissions specified in the grant. // // To specify the grantee principal, use the Amazon Resource Name (ARN) of an // Amazon Web Services principal. Valid principals include Amazon Web Services // accounts, IAM users, IAM roles, federated users, and assumed role users. // For help with the ARN syntax for a principal, see IAM ARNs (path_to_url#identifiers-arns) // in the Identity and Access Management User Guide . // // GranteePrincipal is a required field GranteePrincipal *string `min:"1" type:"string" required:"true"` // Identifies the KMS key for the grant. The grant gives principals permission // to use this KMS key. // // Specify the key ID or key ARN of the KMS key. To specify a KMS key in a different // Amazon Web Services account, you must use the key ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // A friendly name for the grant. Use this value to prevent the unintended creation // of duplicate grants when retrying this request. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // When this value is absent, all CreateGrant requests result in a new grant // with a unique GrantId even if all the supplied parameters are identical. // This can result in unintended duplicates when you retry the CreateGrant request. // // When this value is present, you can retry a CreateGrant request with identical // parameters; if the grant already exists, the original GrantId is returned // without creating a new grant. Note that the returned grant token is unique // with every CreateGrant request, even when a duplicate GrantId is returned. // All grant tokens for the same grant ID can be used interchangeably. Name *string `min:"1" type:"string"` // A list of operations that the grant permits. // // This list must include only operations that are permitted in a grant. Also, // the operation must be supported on the KMS key. For example, you cannot create // a grant for a symmetric encryption KMS key that allows the Sign operation, // or a grant for an asymmetric KMS key that allows the GenerateDataKey operation. // If you try, KMS returns a ValidationError exception. For details, see Grant // operations (path_to_url#terms-grant-operations) // in the Key Management Service Developer Guide. // // Operations is a required field Operations []*string `type:"list" required:"true" enum:"GrantOperation"` // The principal that has permission to use the RetireGrant operation to retire // the grant. // // To specify the principal, use the Amazon Resource Name (ARN) (path_to_url // of an Amazon Web Services principal. Valid principals include Amazon Web // Services accounts, IAM users, IAM roles, federated users, and assumed role // users. For help with the ARN syntax for a principal, see IAM ARNs (path_to_url#identifiers-arns) // in the Identity and Access Management User Guide . // // The grant determines the retiring principal. Other principals might have // permission to retire the grant or revoke the grant. For details, see RevokeGrant // and Retiring and revoking grants (path_to_url#grant-delete) // in the Key Management Service Developer Guide. RetiringPrincipal *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateGrantInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateGrantInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *CreateGrantInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "CreateGrantInput"} if s.GranteePrincipal == nil { invalidParams.Add(request.NewErrParamRequired("GranteePrincipal")) } if s.GranteePrincipal != nil && len(*s.GranteePrincipal) < 1 { invalidParams.Add(request.NewErrParamMinLen("GranteePrincipal", 1)) } if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.Name != nil && len(*s.Name) < 1 { invalidParams.Add(request.NewErrParamMinLen("Name", 1)) } if s.Operations == nil { invalidParams.Add(request.NewErrParamRequired("Operations")) } if s.RetiringPrincipal != nil && len(*s.RetiringPrincipal) < 1 { invalidParams.Add(request.NewErrParamMinLen("RetiringPrincipal", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetConstraints sets the Constraints field's value. func (s *CreateGrantInput) SetConstraints(v *GrantConstraints) *CreateGrantInput { s.Constraints = v return s } // SetDryRun sets the DryRun field's value. func (s *CreateGrantInput) SetDryRun(v bool) *CreateGrantInput { s.DryRun = &v return s } // SetGrantTokens sets the GrantTokens field's value. func (s *CreateGrantInput) SetGrantTokens(v []*string) *CreateGrantInput { s.GrantTokens = v return s } // SetGranteePrincipal sets the GranteePrincipal field's value. func (s *CreateGrantInput) SetGranteePrincipal(v string) *CreateGrantInput { s.GranteePrincipal = &v return s } // SetKeyId sets the KeyId field's value. func (s *CreateGrantInput) SetKeyId(v string) *CreateGrantInput { s.KeyId = &v return s } // SetName sets the Name field's value. func (s *CreateGrantInput) SetName(v string) *CreateGrantInput { s.Name = &v return s } // SetOperations sets the Operations field's value. func (s *CreateGrantInput) SetOperations(v []*string) *CreateGrantInput { s.Operations = v return s } // SetRetiringPrincipal sets the RetiringPrincipal field's value. func (s *CreateGrantInput) SetRetiringPrincipal(v string) *CreateGrantInput { s.RetiringPrincipal = &v return s } type CreateGrantOutput struct { _ struct{} `type:"structure"` // The unique identifier for the grant. // // You can use the GrantId in a ListGrants, RetireGrant, or RevokeGrant operation. GrantId *string `min:"1" type:"string"` // The grant token. // // Use a grant token when your permission to call this operation comes from // a new grant that has not yet achieved eventual consistency. For more information, // see Grant token (path_to_url#grant_token) // and Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide. GrantToken *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateGrantOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateGrantOutput) GoString() string { return s.String() } // SetGrantId sets the GrantId field's value. func (s *CreateGrantOutput) SetGrantId(v string) *CreateGrantOutput { s.GrantId = &v return s } // SetGrantToken sets the GrantToken field's value. func (s *CreateGrantOutput) SetGrantToken(v string) *CreateGrantOutput { s.GrantToken = &v return s } type CreateKeyInput struct { _ struct{} `type:"structure"` // Skips ("bypasses") the key policy lockout safety check. The default value // is false. // // Setting this value to true increases the risk that the KMS key becomes unmanageable. // Do not set this value to true indiscriminately. // // For more information, see Default key policy (path_to_url#prevent-unmanageable-key) // in the Key Management Service Developer Guide. // // Use this parameter only when you intend to prevent the principal that is // making the request from making a subsequent PutKeyPolicy (path_to_url // request on the KMS key. BypassPolicyLockoutSafetyCheck *bool `type:"boolean"` // Creates the KMS key in the specified custom key store (path_to_url // The ConnectionState of the custom key store must be CONNECTED. To find the // CustomKeyStoreID and ConnectionState use the DescribeCustomKeyStores operation. // // This parameter is valid only for symmetric encryption KMS keys in a single // Region. You cannot create any other type of KMS key in a custom key store. // // When you create a KMS key in an CloudHSM key store, KMS generates a non-exportable // 256-bit symmetric key in its associated CloudHSM cluster and associates it // with the KMS key. When you create a KMS key in an external key store, you // must use the XksKeyId parameter to specify an external key that serves as // key material for the KMS key. CustomKeyStoreId *string `min:"1" type:"string"` // Instead, use the KeySpec parameter. // // The KeySpec and CustomerMasterKeySpec parameters work the same way. Only // the names differ. We recommend that you use KeySpec parameter in your code. // However, to avoid breaking changes, KMS supports both parameters. // // Deprecated: This parameter has been deprecated. Instead, use the KeySpec parameter. CustomerMasterKeySpec *string `deprecated:"true" type:"string" enum:"CustomerMasterKeySpec"` // A description of the KMS key. Use a description that helps you decide whether // the KMS key is appropriate for a task. The default value is an empty string // (no description). // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // To set or change the description after the key is created, use UpdateKeyDescription. Description *string `type:"string"` // Specifies the type of KMS key to create. The default value, SYMMETRIC_DEFAULT, // creates a KMS key with a 256-bit AES-GCM key that is used for encryption // and decryption, except in China Regions, where it creates a 128-bit symmetric // key that uses SM4 encryption. For help choosing a key spec for your KMS key, // see Choosing a KMS key type (path_to_url#symm-asymm-choose) // in the Key Management Service Developer Guide . // // The KeySpec determines whether the KMS key contains a symmetric key or an // asymmetric key pair. It also determines the algorithms that the KMS key supports. // You can't change the KeySpec after the KMS key is created. To further restrict // the algorithms that can be used with the KMS key, use a condition key in // its key policy or IAM policy. For more information, see kms:EncryptionAlgorithm // (path_to_url#conditions-kms-encryption-algorithm), // kms:MacAlgorithm (path_to_url#conditions-kms-mac-algorithm) // or kms:Signing Algorithm (path_to_url#conditions-kms-signing-algorithm) // in the Key Management Service Developer Guide . // // Amazon Web Services services that are integrated with KMS (path_to_url#AWS_Service_Integration) // use symmetric encryption KMS keys to protect your data. These services do // not support asymmetric KMS keys or HMAC KMS keys. // // KMS supports the following key specs for KMS keys: // // * Symmetric encryption key (default) SYMMETRIC_DEFAULT // // * HMAC keys (symmetric) HMAC_224 HMAC_256 HMAC_384 HMAC_512 // // * Asymmetric RSA key pairs RSA_2048 RSA_3072 RSA_4096 // // * Asymmetric NIST-recommended elliptic curve key pairs ECC_NIST_P256 (secp256r1) // ECC_NIST_P384 (secp384r1) ECC_NIST_P521 (secp521r1) // // * Other asymmetric elliptic curve key pairs ECC_SECG_P256K1 (secp256k1), // commonly used for cryptocurrencies. // // * SM2 key pairs (China Regions only) SM2 KeySpec *string `type:"string" enum:"KeySpec"` // Determines the cryptographic operations (path_to_url#cryptographic-operations) // for which you can use the KMS key. The default value is ENCRYPT_DECRYPT. // This parameter is optional when you are creating a symmetric encryption KMS // key; otherwise, it is required. You can't change the KeyUsage value after // the KMS key is created. // // Select only one valid value. // // * For symmetric encryption KMS keys, omit the parameter or specify ENCRYPT_DECRYPT. // // * For HMAC KMS keys (symmetric), specify GENERATE_VERIFY_MAC. // // * For asymmetric KMS keys with RSA key material, specify ENCRYPT_DECRYPT // or SIGN_VERIFY. // // * For asymmetric KMS keys with ECC key material, specify SIGN_VERIFY. // // * For asymmetric KMS keys with SM2 key material (China Regions only), // specify ENCRYPT_DECRYPT or SIGN_VERIFY. KeyUsage *string `type:"string" enum:"KeyUsageType"` // Creates a multi-Region primary key that you can replicate into other Amazon // Web Services Regions. You cannot change this value after you create the KMS // key. // // For a multi-Region key, set this parameter to True. For a single-Region KMS // key, omit this parameter or set it to False. The default value is False. // // This operation supports multi-Region keys, an KMS feature that lets you create // multiple interoperable KMS keys in different Amazon Web Services Regions. // Because these KMS keys have the same key ID, key material, and other metadata, // you can use them interchangeably to encrypt data in one Amazon Web Services // Region and decrypt it in a different Amazon Web Services Region without re-encrypting // the data or making a cross-Region call. For more information about multi-Region // keys, see Multi-Region keys in KMS (path_to_url // in the Key Management Service Developer Guide. // // This value creates a primary key, not a replica. To create a replica key, // use the ReplicateKey operation. // // You can create a symmetric or asymmetric multi-Region key, and you can create // a multi-Region key with imported key material. However, you cannot create // a multi-Region key in a custom key store. MultiRegion *bool `type:"boolean"` // The source of the key material for the KMS key. You cannot change the origin // after you create the KMS key. The default is AWS_KMS, which means that KMS // creates the key material. // // To create a KMS key with no key material (path_to_url // (for imported key material), set this value to EXTERNAL. For more information // about importing key material into KMS, see Importing Key Material (path_to_url // in the Key Management Service Developer Guide. The EXTERNAL origin value // is valid only for symmetric KMS keys. // // To create a KMS key in an CloudHSM key store (path_to_url // and create its key material in the associated CloudHSM cluster, set this // value to AWS_CLOUDHSM. You must also use the CustomKeyStoreId parameter to // identify the CloudHSM key store. The KeySpec value must be SYMMETRIC_DEFAULT. // // To create a KMS key in an external key store (path_to_url // set this value to EXTERNAL_KEY_STORE. You must also use the CustomKeyStoreId // parameter to identify the external key store and the XksKeyId parameter to // identify the associated external key. The KeySpec value must be SYMMETRIC_DEFAULT. Origin *string `type:"string" enum:"OriginType"` // The key policy to attach to the KMS key. // // If you provide a key policy, it must meet the following criteria: // // * The key policy must allow the calling principal to make a subsequent // PutKeyPolicy request on the KMS key. This reduces the risk that the KMS // key becomes unmanageable. For more information, see Default key policy // (path_to_url#prevent-unmanageable-key) // in the Key Management Service Developer Guide. (To omit this condition, // set BypassPolicyLockoutSafetyCheck to true.) // // * Each statement in the key policy must contain one or more principals. // The principals in the key policy must exist and be visible to KMS. When // you create a new Amazon Web Services principal, you might need to enforce // a delay before including the new principal in a key policy because the // new principal might not be immediately visible to KMS. For more information, // see Changes that I make are not always immediately visible (path_to_url#troubleshoot_general_eventual-consistency) // in the Amazon Web Services Identity and Access Management User Guide. // // If you do not provide a key policy, KMS attaches a default key policy to // the KMS key. For more information, see Default key policy (path_to_url#key-policy-default) // in the Key Management Service Developer Guide. // // The key policy size quota is 32 kilobytes (32768 bytes). // // For help writing and formatting a JSON policy document, see the IAM JSON // Policy Reference (path_to_url // in the Identity and Access Management User Guide . Policy *string `min:"1" type:"string"` // Assigns one or more tags to the KMS key. Use this parameter to tag the KMS // key when it is created. To tag an existing KMS key, use the TagResource operation. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // Tagging or untagging a KMS key can allow or deny permission to the KMS key. // For details, see ABAC for KMS (path_to_url // in the Key Management Service Developer Guide. // // To use this parameter, you must have kms:TagResource (path_to_url // permission in an IAM policy. // // Each tag consists of a tag key and a tag value. Both the tag key and the // tag value are required, but the tag value can be an empty (null) string. // You cannot have more than one tag on a KMS key with the same tag key. If // you specify an existing tag key with a different tag value, KMS replaces // the current tag value with the specified one. // // When you add tags to an Amazon Web Services resource, Amazon Web Services // generates a cost allocation report with usage and costs aggregated by tags. // Tags can also be used to control access to a KMS key. For details, see Tagging // Keys (path_to_url Tags []*Tag `type:"list"` // Identifies the external key (path_to_url#concept-external-key) // that serves as key material for the KMS key in an external key store (path_to_url // Specify the ID that the external key store proxy (path_to_url#concept-xks-proxy) // uses to refer to the external key. For help, see the documentation for your // external key store proxy. // // This parameter is required for a KMS key with an Origin value of EXTERNAL_KEY_STORE. // It is not valid for KMS keys with any other Origin value. // // The external key must be an existing 256-bit AES symmetric encryption key // hosted outside of Amazon Web Services in an external key manager associated // with the external key store specified by the CustomKeyStoreId parameter. // This key must be enabled and configured to perform encryption and decryption. // Each KMS key in an external key store must use a different external key. // For details, see Requirements for a KMS key in an external key store (path_to_url#xks-key-requirements) // in the Key Management Service Developer Guide. // // Each KMS key in an external key store is associated two backing keys. One // is key material that KMS generates. The other is the external key specified // by this parameter. When you use the KMS key in an external key store to encrypt // data, the encryption operation is performed first by KMS using the KMS key // material, and then by the external key manager using the specified external // key, a process known as double encryption. For details, see Double encryption // (path_to_url#concept-double-encryption) // in the Key Management Service Developer Guide. XksKeyId *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateKeyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateKeyInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *CreateKeyInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "CreateKeyInput"} if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) } if s.Policy != nil && len(*s.Policy) < 1 { invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) } if s.XksKeyId != nil && len(*s.XksKeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("XksKeyId", 1)) } if s.Tags != nil { for i, v := range s.Tags { if v == nil { continue } if err := v.Validate(); err != nil { invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) } } } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetBypassPolicyLockoutSafetyCheck sets the BypassPolicyLockoutSafetyCheck field's value. func (s *CreateKeyInput) SetBypassPolicyLockoutSafetyCheck(v bool) *CreateKeyInput { s.BypassPolicyLockoutSafetyCheck = &v return s } // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. func (s *CreateKeyInput) SetCustomKeyStoreId(v string) *CreateKeyInput { s.CustomKeyStoreId = &v return s } // SetCustomerMasterKeySpec sets the CustomerMasterKeySpec field's value. func (s *CreateKeyInput) SetCustomerMasterKeySpec(v string) *CreateKeyInput { s.CustomerMasterKeySpec = &v return s } // SetDescription sets the Description field's value. func (s *CreateKeyInput) SetDescription(v string) *CreateKeyInput { s.Description = &v return s } // SetKeySpec sets the KeySpec field's value. func (s *CreateKeyInput) SetKeySpec(v string) *CreateKeyInput { s.KeySpec = &v return s } // SetKeyUsage sets the KeyUsage field's value. func (s *CreateKeyInput) SetKeyUsage(v string) *CreateKeyInput { s.KeyUsage = &v return s } // SetMultiRegion sets the MultiRegion field's value. func (s *CreateKeyInput) SetMultiRegion(v bool) *CreateKeyInput { s.MultiRegion = &v return s } // SetOrigin sets the Origin field's value. func (s *CreateKeyInput) SetOrigin(v string) *CreateKeyInput { s.Origin = &v return s } // SetPolicy sets the Policy field's value. func (s *CreateKeyInput) SetPolicy(v string) *CreateKeyInput { s.Policy = &v return s } // SetTags sets the Tags field's value. func (s *CreateKeyInput) SetTags(v []*Tag) *CreateKeyInput { s.Tags = v return s } // SetXksKeyId sets the XksKeyId field's value. func (s *CreateKeyInput) SetXksKeyId(v string) *CreateKeyInput { s.XksKeyId = &v return s } type CreateKeyOutput struct { _ struct{} `type:"structure"` // Metadata associated with the KMS key. KeyMetadata *KeyMetadata `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateKeyOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CreateKeyOutput) GoString() string { return s.String() } // SetKeyMetadata sets the KeyMetadata field's value. func (s *CreateKeyOutput) SetKeyMetadata(v *KeyMetadata) *CreateKeyOutput { s.KeyMetadata = v return s } // The request was rejected because the custom key store contains KMS keys. // After verifying that you do not need to use the KMS keys, use the ScheduleKeyDeletion // operation to delete the KMS keys. After they are deleted, you can delete // the custom key store. type CustomKeyStoreHasCMKsException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CustomKeyStoreHasCMKsException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CustomKeyStoreHasCMKsException) GoString() string { return s.String() } func newErrorCustomKeyStoreHasCMKsException(v protocol.ResponseMetadata) error { return &CustomKeyStoreHasCMKsException{ RespMetadata: v, } } // Code returns the exception type name. func (s *CustomKeyStoreHasCMKsException) Code() string { return "CustomKeyStoreHasCMKsException" } // Message returns the exception's message. func (s *CustomKeyStoreHasCMKsException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *CustomKeyStoreHasCMKsException) OrigErr() error { return nil } func (s *CustomKeyStoreHasCMKsException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *CustomKeyStoreHasCMKsException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *CustomKeyStoreHasCMKsException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because of the ConnectionState of the custom key // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores // operation. // // This exception is thrown under the following conditions: // // - You requested the ConnectCustomKeyStore operation on a custom key store // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid // for all other ConnectionState values. To reconnect a custom key store // in a FAILED state, disconnect it (DisconnectCustomKeyStore), then connect // it (ConnectCustomKeyStore). // // - You requested the CreateKey operation in a custom key store that is // not connected. This operations is valid only when the custom key store // ConnectionState is CONNECTED. // // - You requested the DisconnectCustomKeyStore operation on a custom key // store with a ConnectionState of DISCONNECTING or DISCONNECTED. This operation // is valid for all other ConnectionState values. // // - You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation // on a custom key store that is not disconnected. This operation is valid // only when the custom key store ConnectionState is DISCONNECTED. // // - You requested the GenerateRandom operation in an CloudHSM key store // that is not connected. This operation is valid only when the CloudHSM // key store ConnectionState is CONNECTED. type CustomKeyStoreInvalidStateException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CustomKeyStoreInvalidStateException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CustomKeyStoreInvalidStateException) GoString() string { return s.String() } func newErrorCustomKeyStoreInvalidStateException(v protocol.ResponseMetadata) error { return &CustomKeyStoreInvalidStateException{ RespMetadata: v, } } // Code returns the exception type name. func (s *CustomKeyStoreInvalidStateException) Code() string { return "CustomKeyStoreInvalidStateException" } // Message returns the exception's message. func (s *CustomKeyStoreInvalidStateException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *CustomKeyStoreInvalidStateException) OrigErr() error { return nil } func (s *CustomKeyStoreInvalidStateException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *CustomKeyStoreInvalidStateException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *CustomKeyStoreInvalidStateException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the specified custom key store name is already // assigned to another custom key store in the account. Try again with a custom // key store name that is unique in the account. type CustomKeyStoreNameInUseException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CustomKeyStoreNameInUseException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CustomKeyStoreNameInUseException) GoString() string { return s.String() } func newErrorCustomKeyStoreNameInUseException(v protocol.ResponseMetadata) error { return &CustomKeyStoreNameInUseException{ RespMetadata: v, } } // Code returns the exception type name. func (s *CustomKeyStoreNameInUseException) Code() string { return "CustomKeyStoreNameInUseException" } // Message returns the exception's message. func (s *CustomKeyStoreNameInUseException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *CustomKeyStoreNameInUseException) OrigErr() error { return nil } func (s *CustomKeyStoreNameInUseException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *CustomKeyStoreNameInUseException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *CustomKeyStoreNameInUseException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because KMS cannot find a custom key store with // the specified key store name or ID. type CustomKeyStoreNotFoundException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CustomKeyStoreNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CustomKeyStoreNotFoundException) GoString() string { return s.String() } func newErrorCustomKeyStoreNotFoundException(v protocol.ResponseMetadata) error { return &CustomKeyStoreNotFoundException{ RespMetadata: v, } } // Code returns the exception type name. func (s *CustomKeyStoreNotFoundException) Code() string { return "CustomKeyStoreNotFoundException" } // Message returns the exception's message. func (s *CustomKeyStoreNotFoundException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *CustomKeyStoreNotFoundException) OrigErr() error { return nil } func (s *CustomKeyStoreNotFoundException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *CustomKeyStoreNotFoundException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *CustomKeyStoreNotFoundException) RequestID() string { return s.RespMetadata.RequestID } // Contains information about each custom key store in the custom key store // list. type CustomKeyStoresListEntry struct { _ struct{} `type:"structure"` // A unique identifier for the CloudHSM cluster that is associated with an CloudHSM // key store. This field appears only when the CustomKeyStoreType is AWS_CLOUDHSM. CloudHsmClusterId *string `min:"19" type:"string"` // Describes the connection error. This field appears in the response only when // the ConnectionState is FAILED. // // Many failures can be resolved by updating the properties of the custom key // store. To update a custom key store, disconnect it (DisconnectCustomKeyStore), // correct the errors (UpdateCustomKeyStore), and try to connect again (ConnectCustomKeyStore). // For additional help resolving these errors, see How to Fix a Connection Failure // (path_to_url#fix-keystore-failed) // in Key Management Service Developer Guide. // // All custom key stores: // // * INTERNAL_ERROR KMS could not complete the request due to an internal // error. Retry the request. For ConnectCustomKeyStore requests, disconnect // the custom key store before trying to connect again. // // * NETWORK_ERRORS Network errors are preventing KMS from connecting // the custom key store to its backing key store. // // CloudHSM key stores: // // * CLUSTER_NOT_FOUND KMS cannot find the CloudHSM cluster with the // specified cluster ID. // // * INSUFFICIENT_CLOUDHSM_HSMS The associated CloudHSM cluster does // not contain any active HSMs. To connect a custom key store to its CloudHSM // cluster, the cluster must contain at least one active HSM. // // * INSUFFICIENT_FREE_ADDRESSES_IN_SUBNET At least one private subnet // associated with the CloudHSM cluster doesn't have any available IP addresses. // A CloudHSM key store connection requires one free IP address in each of // the associated private subnets, although two are preferable. For details, // see How to Fix a Connection Failure (path_to_url#fix-keystore-failed) // in the Key Management Service Developer Guide. // // * INVALID_CREDENTIALS The KeyStorePassword for the custom key store // doesn't match the current password of the kmsuser crypto user in the CloudHSM // cluster. Before you can connect your custom key store to its CloudHSM // cluster, you must change the kmsuser account password and update the KeyStorePassword // value for the custom key store. // // * SUBNET_NOT_FOUND A subnet in the CloudHSM cluster configuration // was deleted. If KMS cannot find all of the subnets in the cluster configuration, // attempts to connect the custom key store to the CloudHSM cluster fail. // To fix this error, create a cluster from a recent backup and associate // it with your custom key store. (This process creates a new cluster configuration // with a VPC and private subnets.) For details, see How to Fix a Connection // Failure (path_to_url#fix-keystore-failed) // in the Key Management Service Developer Guide. // // * USER_LOCKED_OUT The kmsuser CU account is locked out of the associated // CloudHSM cluster due to too many failed password attempts. Before you // can connect your custom key store to its CloudHSM cluster, you must change // the kmsuser account password and update the key store password value for // the custom key store. // // * USER_LOGGED_IN The kmsuser CU account is logged into the associated // CloudHSM cluster. This prevents KMS from rotating the kmsuser account // password and logging into the cluster. Before you can connect your custom // key store to its CloudHSM cluster, you must log the kmsuser CU out of // the cluster. If you changed the kmsuser password to log into the cluster, // you must also and update the key store password value for the custom key // store. For help, see How to Log Out and Reconnect (path_to_url#login-kmsuser-2) // in the Key Management Service Developer Guide. // // * USER_NOT_FOUND KMS cannot find a kmsuser CU account in the associated // CloudHSM cluster. Before you can connect your custom key store to its // CloudHSM cluster, you must create a kmsuser CU account in the cluster, // and then update the key store password value for the custom key store. // // External key stores: // // * INVALID_CREDENTIALS One or both of the XksProxyAuthenticationCredential // values is not valid on the specified external key store proxy. // // * XKS_PROXY_ACCESS_DENIED KMS requests are denied access to the external // key store proxy. If the external key store proxy has authorization rules, // verify that they permit KMS to communicate with the proxy on your behalf. // // * XKS_PROXY_INVALID_CONFIGURATION A configuration error is preventing // the external key store from connecting to its proxy. Verify the value // of the XksProxyUriPath. // // * XKS_PROXY_INVALID_RESPONSE KMS cannot interpret the response from // the external key store proxy. If you see this connection error code repeatedly, // notify your external key store proxy vendor. // // * XKS_PROXY_INVALID_TLS_CONFIGURATION KMS cannot connect to the external // key store proxy because the TLS configuration is invalid. Verify that // the XKS proxy supports TLS 1.2 or 1.3. Also, verify that the TLS certificate // is not expired, and that it matches the hostname in the XksProxyUriEndpoint // value, and that it is signed by a certificate authority included in the // Trusted Certificate Authorities (path_to_url // list. // // * XKS_PROXY_NOT_REACHABLE KMS can't communicate with your external // key store proxy. Verify that the XksProxyUriEndpoint and XksProxyUriPath // are correct. Use the tools for your external key store proxy to verify // that the proxy is active and available on its network. Also, verify that // your external key manager instances are operating properly. Connection // attempts fail with this connection error code if the proxy reports that // all external key manager instances are unavailable. // // * XKS_PROXY_TIMED_OUT KMS can connect to the external key store proxy, // but the proxy does not respond to KMS in the time allotted. If you see // this connection error code repeatedly, notify your external key store // proxy vendor. // // * XKS_VPC_ENDPOINT_SERVICE_INVALID_CONFIGURATION The Amazon VPC endpoint // service configuration doesn't conform to the requirements for an KMS external // key store. The VPC endpoint service must be an endpoint service for interface // endpoints in the caller's Amazon Web Services account. It must have a // network load balancer (NLB) connected to at least two subnets, each in // a different Availability Zone. The Allow principals list must include // the KMS service principal for the Region, cks.kms.<region>.amazonaws.com, // such as cks.kms.us-east-1.amazonaws.com. It must not require acceptance // (path_to_url // of connection requests. It must have a private DNS name. The private DNS // name for an external key store with VPC_ENDPOINT_SERVICE connectivity // must be unique in its Amazon Web Services Region. The domain of the private // DNS name must have a verification status (path_to_url // of verified. The TLS certificate (path_to_url // specifies the private DNS hostname at which the endpoint is reachable. // // * XKS_VPC_ENDPOINT_SERVICE_NOT_FOUND KMS can't find the VPC endpoint // service that it uses to communicate with the external key store proxy. // Verify that the XksProxyVpcEndpointServiceName is correct and the KMS // service principal has service consumer permissions on the Amazon VPC endpoint // service. ConnectionErrorCode *string `type:"string" enum:"ConnectionErrorCodeType"` // Indicates whether the custom key store is connected to its backing key store. // For an CloudHSM key store, the ConnectionState indicates whether it is connected // to its CloudHSM cluster. For an external key store, the ConnectionState indicates // whether it is connected to the external key store proxy that communicates // with your external key manager. // // You can create and use KMS keys in your custom key stores only when its ConnectionState // is CONNECTED. // // The ConnectionState value is DISCONNECTED only if the key store has never // been connected or you use the DisconnectCustomKeyStore operation to disconnect // it. If the value is CONNECTED but you are having trouble using the custom // key store, make sure that the backing key store is reachable and active. // For an CloudHSM key store, verify that its associated CloudHSM cluster is // active and contains at least one active HSM. For an external key store, verify // that the external key store proxy and external key manager are connected // and enabled. // // A value of FAILED indicates that an attempt to connect was unsuccessful. // The ConnectionErrorCode field in the response indicates the cause of the // failure. For help resolving a connection failure, see Troubleshooting a custom // key store (path_to_url // in the Key Management Service Developer Guide. ConnectionState *string `type:"string" enum:"ConnectionStateType"` // The date and time when the custom key store was created. CreationDate *time.Time `type:"timestamp"` // A unique identifier for the custom key store. CustomKeyStoreId *string `min:"1" type:"string"` // The user-specified friendly name for the custom key store. CustomKeyStoreName *string `min:"1" type:"string"` // Indicates the type of the custom key store. AWS_CLOUDHSM indicates a custom // key store backed by an CloudHSM cluster. EXTERNAL_KEY_STORE indicates a custom // key store backed by an external key store proxy and external key manager // outside of Amazon Web Services. CustomKeyStoreType *string `type:"string" enum:"CustomKeyStoreType"` // The trust anchor certificate of the CloudHSM cluster associated with an CloudHSM // key store. When you initialize the cluster (path_to_url#sign-csr), // you create this certificate and save it in the customerCA.crt file. // // This field appears only when the CustomKeyStoreType is AWS_CLOUDHSM. TrustAnchorCertificate *string `min:"1" type:"string"` // Configuration settings for the external key store proxy (XKS proxy). The // external key store proxy translates KMS requests into a format that your // external key manager can understand. The proxy configuration includes connection // information that KMS requires. // // This field appears only when the CustomKeyStoreType is EXTERNAL_KEY_STORE. XksProxyConfiguration *XksProxyConfigurationType `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CustomKeyStoresListEntry) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s CustomKeyStoresListEntry) GoString() string { return s.String() } // SetCloudHsmClusterId sets the CloudHsmClusterId field's value. func (s *CustomKeyStoresListEntry) SetCloudHsmClusterId(v string) *CustomKeyStoresListEntry { s.CloudHsmClusterId = &v return s } // SetConnectionErrorCode sets the ConnectionErrorCode field's value. func (s *CustomKeyStoresListEntry) SetConnectionErrorCode(v string) *CustomKeyStoresListEntry { s.ConnectionErrorCode = &v return s } // SetConnectionState sets the ConnectionState field's value. func (s *CustomKeyStoresListEntry) SetConnectionState(v string) *CustomKeyStoresListEntry { s.ConnectionState = &v return s } // SetCreationDate sets the CreationDate field's value. func (s *CustomKeyStoresListEntry) SetCreationDate(v time.Time) *CustomKeyStoresListEntry { s.CreationDate = &v return s } // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. func (s *CustomKeyStoresListEntry) SetCustomKeyStoreId(v string) *CustomKeyStoresListEntry { s.CustomKeyStoreId = &v return s } // SetCustomKeyStoreName sets the CustomKeyStoreName field's value. func (s *CustomKeyStoresListEntry) SetCustomKeyStoreName(v string) *CustomKeyStoresListEntry { s.CustomKeyStoreName = &v return s } // SetCustomKeyStoreType sets the CustomKeyStoreType field's value. func (s *CustomKeyStoresListEntry) SetCustomKeyStoreType(v string) *CustomKeyStoresListEntry { s.CustomKeyStoreType = &v return s } // SetTrustAnchorCertificate sets the TrustAnchorCertificate field's value. func (s *CustomKeyStoresListEntry) SetTrustAnchorCertificate(v string) *CustomKeyStoresListEntry { s.TrustAnchorCertificate = &v return s } // SetXksProxyConfiguration sets the XksProxyConfiguration field's value. func (s *CustomKeyStoresListEntry) SetXksProxyConfiguration(v *XksProxyConfigurationType) *CustomKeyStoresListEntry { s.XksProxyConfiguration = v return s } type DecryptInput struct { _ struct{} `type:"structure"` // Ciphertext to be decrypted. The blob includes metadata. // CiphertextBlob is automatically base64 encoded/decoded by the SDK. // // CiphertextBlob is a required field CiphertextBlob []byte `min:"1" type:"blob" required:"true"` // Checks if your request will succeed. DryRun is an optional parameter. // // To learn more about how to use this parameter, see Testing your KMS API calls // (path_to_url // in the Key Management Service Developer Guide. DryRun *bool `type:"boolean"` // Specifies the encryption algorithm that will be used to decrypt the ciphertext. // Specify the same algorithm that was used to encrypt the data. If you specify // a different algorithm, the Decrypt operation fails. // // This parameter is required only when the ciphertext was encrypted under an // asymmetric KMS key. The default value, SYMMETRIC_DEFAULT, represents the // only supported algorithm that is valid for symmetric encryption KMS keys. EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` // Specifies the encryption context to use when decrypting the data. An encryption // context is valid only for cryptographic operations (path_to_url#cryptographic-operations) // with a symmetric encryption KMS key. The standard asymmetric encryption algorithms // and HMAC algorithms that KMS uses do not support an encryption context. // // An encryption context is a collection of non-secret key-value pairs that // represent additional authenticated data. When you use an encryption context // to encrypt data, you must specify the same (an exact case-sensitive match) // encryption context to decrypt the data. An encryption context is supported // only on operations with symmetric encryption KMS keys. On operations with // symmetric encryption KMS keys, an encryption context is optional, but it // is strongly recommended. // // For more information, see Encryption context (path_to_url#encrypt_context) // in the Key Management Service Developer Guide. EncryptionContext map[string]*string `type:"map"` // A list of grant tokens. // // Use a grant token when your permission to call this operation comes from // a new grant that has not yet achieved eventual consistency. For more information, // see Grant token (path_to_url#grant_token) // and Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // Specifies the KMS key that KMS uses to decrypt the ciphertext. // // Enter a key ID of the KMS key that was used to encrypt the ciphertext. If // you identify a different KMS key, the Decrypt operation throws an IncorrectKeyException. // // This parameter is required only when the ciphertext was encrypted under an // asymmetric KMS key. If you used a symmetric encryption KMS key, KMS can get // the KMS key from metadata that it adds to the symmetric ciphertext blob. // However, it is always recommended as a best practice. This practice ensures // that you use the KMS key that you intend. // // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. // When using an alias name, prefix it with "alias/". To specify a KMS key in // a different Amazon Web Services account, you must use the key ARN or alias // ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // * Alias name: alias/ExampleAlias // // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // To get the alias name and alias ARN, use ListAliases. KeyId *string `min:"1" type:"string"` // A signed attestation document (path_to_url#term-attestdoc) // from an Amazon Web Services Nitro enclave and the encryption algorithm to // use with the enclave's public key. The only valid encryption algorithm is // RSAES_OAEP_SHA_256. // // This parameter only supports attestation documents for Amazon Web Services // Nitro Enclaves. To include this parameter, use the Amazon Web Services Nitro // Enclaves SDK (path_to_url#sdk) // or any Amazon Web Services SDK. // // When you use this parameter, instead of returning the plaintext data, KMS // encrypts the plaintext data with the public key in the attestation document, // and returns the resulting ciphertext in the CiphertextForRecipient field // in the response. This ciphertext can be decrypted only with the private key // in the enclave. The Plaintext field in the response is null or empty. // // For information about the interaction between KMS and Amazon Web Services // Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS (path_to_url // in the Key Management Service Developer Guide. Recipient *RecipientInfo `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DecryptInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DecryptInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *DecryptInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "DecryptInput"} if s.CiphertextBlob == nil { invalidParams.Add(request.NewErrParamRequired("CiphertextBlob")) } if s.CiphertextBlob != nil && len(s.CiphertextBlob) < 1 { invalidParams.Add(request.NewErrParamMinLen("CiphertextBlob", 1)) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.Recipient != nil { if err := s.Recipient.Validate(); err != nil { invalidParams.AddNested("Recipient", err.(request.ErrInvalidParams)) } } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetCiphertextBlob sets the CiphertextBlob field's value. func (s *DecryptInput) SetCiphertextBlob(v []byte) *DecryptInput { s.CiphertextBlob = v return s } // SetDryRun sets the DryRun field's value. func (s *DecryptInput) SetDryRun(v bool) *DecryptInput { s.DryRun = &v return s } // SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value. func (s *DecryptInput) SetEncryptionAlgorithm(v string) *DecryptInput { s.EncryptionAlgorithm = &v return s } // SetEncryptionContext sets the EncryptionContext field's value. func (s *DecryptInput) SetEncryptionContext(v map[string]*string) *DecryptInput { s.EncryptionContext = v return s } // SetGrantTokens sets the GrantTokens field's value. func (s *DecryptInput) SetGrantTokens(v []*string) *DecryptInput { s.GrantTokens = v return s } // SetKeyId sets the KeyId field's value. func (s *DecryptInput) SetKeyId(v string) *DecryptInput { s.KeyId = &v return s } // SetRecipient sets the Recipient field's value. func (s *DecryptInput) SetRecipient(v *RecipientInfo) *DecryptInput { s.Recipient = v return s } type DecryptOutput struct { _ struct{} `type:"structure"` // The plaintext data encrypted with the public key in the attestation document. // // This field is included in the response only when the Recipient parameter // in the request includes a valid attestation document from an Amazon Web Services // Nitro enclave. For information about the interaction between KMS and Amazon // Web Services Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses // KMS (path_to_url // in the Key Management Service Developer Guide. // CiphertextForRecipient is automatically base64 encoded/decoded by the SDK. CiphertextForRecipient []byte `min:"1" type:"blob"` // The encryption algorithm that was used to decrypt the ciphertext. EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` // The Amazon Resource Name (key ARN (path_to_url#key-id-key-ARN)) // of the KMS key that was used to decrypt the ciphertext. KeyId *string `min:"1" type:"string"` // Decrypted plaintext data. When you use the HTTP API or the Amazon Web Services // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. // // If the response includes the CiphertextForRecipient field, the Plaintext // field is null or empty. // // Plaintext is a sensitive parameter and its value will be // replaced with "sensitive" in string returned by DecryptOutput's // String and GoString methods. // // Plaintext is automatically base64 encoded/decoded by the SDK. Plaintext []byte `min:"1" type:"blob" sensitive:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DecryptOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DecryptOutput) GoString() string { return s.String() } // SetCiphertextForRecipient sets the CiphertextForRecipient field's value. func (s *DecryptOutput) SetCiphertextForRecipient(v []byte) *DecryptOutput { s.CiphertextForRecipient = v return s } // SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value. func (s *DecryptOutput) SetEncryptionAlgorithm(v string) *DecryptOutput { s.EncryptionAlgorithm = &v return s } // SetKeyId sets the KeyId field's value. func (s *DecryptOutput) SetKeyId(v string) *DecryptOutput { s.KeyId = &v return s } // SetPlaintext sets the Plaintext field's value. func (s *DecryptOutput) SetPlaintext(v []byte) *DecryptOutput { s.Plaintext = v return s } type DeleteAliasInput struct { _ struct{} `type:"structure"` // The alias to be deleted. The alias name must begin with alias/ followed by // the alias name, such as alias/ExampleAlias. // // AliasName is a required field AliasName *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DeleteAliasInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DeleteAliasInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *DeleteAliasInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "DeleteAliasInput"} if s.AliasName == nil { invalidParams.Add(request.NewErrParamRequired("AliasName")) } if s.AliasName != nil && len(*s.AliasName) < 1 { invalidParams.Add(request.NewErrParamMinLen("AliasName", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetAliasName sets the AliasName field's value. func (s *DeleteAliasInput) SetAliasName(v string) *DeleteAliasInput { s.AliasName = &v return s } type DeleteAliasOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DeleteAliasOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DeleteAliasOutput) GoString() string { return s.String() } type DeleteCustomKeyStoreInput struct { _ struct{} `type:"structure"` // Enter the ID of the custom key store you want to delete. To find the ID of // a custom key store, use the DescribeCustomKeyStores operation. // // CustomKeyStoreId is a required field CustomKeyStoreId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DeleteCustomKeyStoreInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DeleteCustomKeyStoreInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *DeleteCustomKeyStoreInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "DeleteCustomKeyStoreInput"} if s.CustomKeyStoreId == nil { invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreId")) } if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. func (s *DeleteCustomKeyStoreInput) SetCustomKeyStoreId(v string) *DeleteCustomKeyStoreInput { s.CustomKeyStoreId = &v return s } type DeleteCustomKeyStoreOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DeleteCustomKeyStoreOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DeleteCustomKeyStoreOutput) GoString() string { return s.String() } type DeleteImportedKeyMaterialInput struct { _ struct{} `type:"structure"` // Identifies the KMS key from which you are deleting imported key material. // The Origin of the KMS key must be EXTERNAL. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DeleteImportedKeyMaterialInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DeleteImportedKeyMaterialInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *DeleteImportedKeyMaterialInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "DeleteImportedKeyMaterialInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *DeleteImportedKeyMaterialInput) SetKeyId(v string) *DeleteImportedKeyMaterialInput { s.KeyId = &v return s } type DeleteImportedKeyMaterialOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DeleteImportedKeyMaterialOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DeleteImportedKeyMaterialOutput) GoString() string { return s.String() } // The system timed out while trying to fulfill the request. You can retry the // request. type DependencyTimeoutException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DependencyTimeoutException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DependencyTimeoutException) GoString() string { return s.String() } func newErrorDependencyTimeoutException(v protocol.ResponseMetadata) error { return &DependencyTimeoutException{ RespMetadata: v, } } // Code returns the exception type name. func (s *DependencyTimeoutException) Code() string { return "DependencyTimeoutException" } // Message returns the exception's message. func (s *DependencyTimeoutException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *DependencyTimeoutException) OrigErr() error { return nil } func (s *DependencyTimeoutException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *DependencyTimeoutException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *DependencyTimeoutException) RequestID() string { return s.RespMetadata.RequestID } type DescribeCustomKeyStoresInput struct { _ struct{} `type:"structure"` // Gets only information about the specified custom key store. Enter the key // store ID. // // By default, this operation gets information about all custom key stores in // the account and Region. To limit the output to a particular custom key store, // provide either the CustomKeyStoreId or CustomKeyStoreName parameter, but // not both. CustomKeyStoreId *string `min:"1" type:"string"` // Gets only information about the specified custom key store. Enter the friendly // name of the custom key store. // // By default, this operation gets information about all custom key stores in // the account and Region. To limit the output to a particular custom key store, // provide either the CustomKeyStoreId or CustomKeyStoreName parameter, but // not both. CustomKeyStoreName *string `min:"1" type:"string"` // Use this parameter to specify the maximum number of items to return. When // this value is present, KMS does not return more than the specified number // of items, but it might return fewer. Limit *int64 `min:"1" type:"integer"` // Use this parameter in a subsequent request after you receive a response with // truncated results. Set it to the value of NextMarker from the truncated response // you just received. Marker *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DescribeCustomKeyStoresInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DescribeCustomKeyStoresInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *DescribeCustomKeyStoresInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "DescribeCustomKeyStoresInput"} if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) } if s.CustomKeyStoreName != nil && len(*s.CustomKeyStoreName) < 1 { invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreName", 1)) } if s.Limit != nil && *s.Limit < 1 { invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) } if s.Marker != nil && len(*s.Marker) < 1 { invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. func (s *DescribeCustomKeyStoresInput) SetCustomKeyStoreId(v string) *DescribeCustomKeyStoresInput { s.CustomKeyStoreId = &v return s } // SetCustomKeyStoreName sets the CustomKeyStoreName field's value. func (s *DescribeCustomKeyStoresInput) SetCustomKeyStoreName(v string) *DescribeCustomKeyStoresInput { s.CustomKeyStoreName = &v return s } // SetLimit sets the Limit field's value. func (s *DescribeCustomKeyStoresInput) SetLimit(v int64) *DescribeCustomKeyStoresInput { s.Limit = &v return s } // SetMarker sets the Marker field's value. func (s *DescribeCustomKeyStoresInput) SetMarker(v string) *DescribeCustomKeyStoresInput { s.Marker = &v return s } type DescribeCustomKeyStoresOutput struct { _ struct{} `type:"structure"` // Contains metadata about each custom key store. CustomKeyStores []*CustomKeyStoresListEntry `type:"list"` // When Truncated is true, this element is present and contains the value to // use for the Marker parameter in a subsequent request. NextMarker *string `min:"1" type:"string"` // A flag that indicates whether there are more items in the list. When this // value is true, the list in this response is truncated. To get more items, // pass the value of the NextMarker element in thisresponse to the Marker parameter // in a subsequent request. Truncated *bool `type:"boolean"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DescribeCustomKeyStoresOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DescribeCustomKeyStoresOutput) GoString() string { return s.String() } // SetCustomKeyStores sets the CustomKeyStores field's value. func (s *DescribeCustomKeyStoresOutput) SetCustomKeyStores(v []*CustomKeyStoresListEntry) *DescribeCustomKeyStoresOutput { s.CustomKeyStores = v return s } // SetNextMarker sets the NextMarker field's value. func (s *DescribeCustomKeyStoresOutput) SetNextMarker(v string) *DescribeCustomKeyStoresOutput { s.NextMarker = &v return s } // SetTruncated sets the Truncated field's value. func (s *DescribeCustomKeyStoresOutput) SetTruncated(v bool) *DescribeCustomKeyStoresOutput { s.Truncated = &v return s } type DescribeKeyInput struct { _ struct{} `type:"structure"` // A list of grant tokens. // // Use a grant token when your permission to call this operation comes from // a new grant that has not yet achieved eventual consistency. For more information, // see Grant token (path_to_url#grant_token) // and Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // Describes the specified KMS key. // // If you specify a predefined Amazon Web Services alias (an Amazon Web Services // alias with no key ID), KMS associates the alias with an Amazon Web Services // managed key (path_to_url##aws-managed-cmk) // and returns its KeyId and Arn in the response. // // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. // When using an alias name, prefix it with "alias/". To specify a KMS key in // a different Amazon Web Services account, you must use the key ARN or alias // ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // * Alias name: alias/ExampleAlias // // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // To get the alias name and alias ARN, use ListAliases. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DescribeKeyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DescribeKeyInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *DescribeKeyInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "DescribeKeyInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetGrantTokens sets the GrantTokens field's value. func (s *DescribeKeyInput) SetGrantTokens(v []*string) *DescribeKeyInput { s.GrantTokens = v return s } // SetKeyId sets the KeyId field's value. func (s *DescribeKeyInput) SetKeyId(v string) *DescribeKeyInput { s.KeyId = &v return s } type DescribeKeyOutput struct { _ struct{} `type:"structure"` // Metadata associated with the key. KeyMetadata *KeyMetadata `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DescribeKeyOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DescribeKeyOutput) GoString() string { return s.String() } // SetKeyMetadata sets the KeyMetadata field's value. func (s *DescribeKeyOutput) SetKeyMetadata(v *KeyMetadata) *DescribeKeyOutput { s.KeyMetadata = v return s } type DisableKeyInput struct { _ struct{} `type:"structure"` // Identifies the KMS key to disable. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisableKeyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisableKeyInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *DisableKeyInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "DisableKeyInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *DisableKeyInput) SetKeyId(v string) *DisableKeyInput { s.KeyId = &v return s } type DisableKeyOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisableKeyOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisableKeyOutput) GoString() string { return s.String() } type DisableKeyRotationInput struct { _ struct{} `type:"structure"` // Identifies a symmetric encryption KMS key. You cannot enable or disable automatic // rotation of asymmetric KMS keys (path_to_url#asymmetric-cmks), // HMAC KMS keys (path_to_url // KMS keys with imported key material (path_to_url // or KMS keys in a custom key store (path_to_url // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisableKeyRotationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisableKeyRotationInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *DisableKeyRotationInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "DisableKeyRotationInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *DisableKeyRotationInput) SetKeyId(v string) *DisableKeyRotationInput { s.KeyId = &v return s } type DisableKeyRotationOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisableKeyRotationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisableKeyRotationOutput) GoString() string { return s.String() } // The request was rejected because the specified KMS key is not enabled. type DisabledException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisabledException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisabledException) GoString() string { return s.String() } func newErrorDisabledException(v protocol.ResponseMetadata) error { return &DisabledException{ RespMetadata: v, } } // Code returns the exception type name. func (s *DisabledException) Code() string { return "DisabledException" } // Message returns the exception's message. func (s *DisabledException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *DisabledException) OrigErr() error { return nil } func (s *DisabledException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *DisabledException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *DisabledException) RequestID() string { return s.RespMetadata.RequestID } type DisconnectCustomKeyStoreInput struct { _ struct{} `type:"structure"` // Enter the ID of the custom key store you want to disconnect. To find the // ID of a custom key store, use the DescribeCustomKeyStores operation. // // CustomKeyStoreId is a required field CustomKeyStoreId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisconnectCustomKeyStoreInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisconnectCustomKeyStoreInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *DisconnectCustomKeyStoreInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "DisconnectCustomKeyStoreInput"} if s.CustomKeyStoreId == nil { invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreId")) } if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. func (s *DisconnectCustomKeyStoreInput) SetCustomKeyStoreId(v string) *DisconnectCustomKeyStoreInput { s.CustomKeyStoreId = &v return s } type DisconnectCustomKeyStoreOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisconnectCustomKeyStoreOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisconnectCustomKeyStoreOutput) GoString() string { return s.String() } // The request was rejected because the DryRun parameter was specified. type DryRunOperationException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DryRunOperationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DryRunOperationException) GoString() string { return s.String() } func newErrorDryRunOperationException(v protocol.ResponseMetadata) error { return &DryRunOperationException{ RespMetadata: v, } } // Code returns the exception type name. func (s *DryRunOperationException) Code() string { return "DryRunOperationException" } // Message returns the exception's message. func (s *DryRunOperationException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *DryRunOperationException) OrigErr() error { return nil } func (s *DryRunOperationException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *DryRunOperationException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *DryRunOperationException) RequestID() string { return s.RespMetadata.RequestID } type EnableKeyInput struct { _ struct{} `type:"structure"` // Identifies the KMS key to enable. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EnableKeyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EnableKeyInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *EnableKeyInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "EnableKeyInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *EnableKeyInput) SetKeyId(v string) *EnableKeyInput { s.KeyId = &v return s } type EnableKeyOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EnableKeyOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EnableKeyOutput) GoString() string { return s.String() } type EnableKeyRotationInput struct { _ struct{} `type:"structure"` // Identifies a symmetric encryption KMS key. You cannot enable automatic rotation // of asymmetric KMS keys (path_to_url // HMAC KMS keys (path_to_url // KMS keys with imported key material (path_to_url // or KMS keys in a custom key store (path_to_url // To enable or disable automatic rotation of a set of related multi-Region // keys (path_to_url#multi-region-rotate), // set the property on the primary key. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EnableKeyRotationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EnableKeyRotationInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *EnableKeyRotationInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "EnableKeyRotationInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *EnableKeyRotationInput) SetKeyId(v string) *EnableKeyRotationInput { s.KeyId = &v return s } type EnableKeyRotationOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EnableKeyRotationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EnableKeyRotationOutput) GoString() string { return s.String() } type EncryptInput struct { _ struct{} `type:"structure"` // Checks if your request will succeed. DryRun is an optional parameter. // // To learn more about how to use this parameter, see Testing your KMS API calls // (path_to_url // in the Key Management Service Developer Guide. DryRun *bool `type:"boolean"` // Specifies the encryption algorithm that KMS will use to encrypt the plaintext // message. The algorithm must be compatible with the KMS key that you specify. // // This parameter is required only for asymmetric KMS keys. The default value, // SYMMETRIC_DEFAULT, is the algorithm used for symmetric encryption KMS keys. // If you are using an asymmetric KMS key, we recommend RSAES_OAEP_SHA_256. // // The SM2PKE algorithm is only available in China Regions. EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` // Specifies the encryption context that will be used to encrypt the data. An // encryption context is valid only for cryptographic operations (path_to_url#cryptographic-operations) // with a symmetric encryption KMS key. The standard asymmetric encryption algorithms // and HMAC algorithms that KMS uses do not support an encryption context. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // An encryption context is a collection of non-secret key-value pairs that // represent additional authenticated data. When you use an encryption context // to encrypt data, you must specify the same (an exact case-sensitive match) // encryption context to decrypt the data. An encryption context is supported // only on operations with symmetric encryption KMS keys. On operations with // symmetric encryption KMS keys, an encryption context is optional, but it // is strongly recommended. // // For more information, see Encryption context (path_to_url#encrypt_context) // in the Key Management Service Developer Guide. EncryptionContext map[string]*string `type:"map"` // A list of grant tokens. // // Use a grant token when your permission to call this operation comes from // a new grant that has not yet achieved eventual consistency. For more information, // see Grant token (path_to_url#grant_token) // and Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // Identifies the KMS key to use in the encryption operation. The KMS key must // have a KeyUsage of ENCRYPT_DECRYPT. To find the KeyUsage of a KMS key, use // the DescribeKey operation. // // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. // When using an alias name, prefix it with "alias/". To specify a KMS key in // a different Amazon Web Services account, you must use the key ARN or alias // ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // * Alias name: alias/ExampleAlias // // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // To get the alias name and alias ARN, use ListAliases. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // Data to be encrypted. // // Plaintext is a sensitive parameter and its value will be // replaced with "sensitive" in string returned by EncryptInput's // String and GoString methods. // // Plaintext is automatically base64 encoded/decoded by the SDK. // // Plaintext is a required field Plaintext []byte `min:"1" type:"blob" required:"true" sensitive:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EncryptInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EncryptInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *EncryptInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "EncryptInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.Plaintext == nil { invalidParams.Add(request.NewErrParamRequired("Plaintext")) } if s.Plaintext != nil && len(s.Plaintext) < 1 { invalidParams.Add(request.NewErrParamMinLen("Plaintext", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetDryRun sets the DryRun field's value. func (s *EncryptInput) SetDryRun(v bool) *EncryptInput { s.DryRun = &v return s } // SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value. func (s *EncryptInput) SetEncryptionAlgorithm(v string) *EncryptInput { s.EncryptionAlgorithm = &v return s } // SetEncryptionContext sets the EncryptionContext field's value. func (s *EncryptInput) SetEncryptionContext(v map[string]*string) *EncryptInput { s.EncryptionContext = v return s } // SetGrantTokens sets the GrantTokens field's value. func (s *EncryptInput) SetGrantTokens(v []*string) *EncryptInput { s.GrantTokens = v return s } // SetKeyId sets the KeyId field's value. func (s *EncryptInput) SetKeyId(v string) *EncryptInput { s.KeyId = &v return s } // SetPlaintext sets the Plaintext field's value. func (s *EncryptInput) SetPlaintext(v []byte) *EncryptInput { s.Plaintext = v return s } type EncryptOutput struct { _ struct{} `type:"structure"` // The encrypted plaintext. When you use the HTTP API or the Amazon Web Services // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. // CiphertextBlob is automatically base64 encoded/decoded by the SDK. CiphertextBlob []byte `min:"1" type:"blob"` // The encryption algorithm that was used to encrypt the plaintext. EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` // The Amazon Resource Name (key ARN (path_to_url#key-id-key-ARN)) // of the KMS key that was used to encrypt the plaintext. KeyId *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EncryptOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EncryptOutput) GoString() string { return s.String() } // SetCiphertextBlob sets the CiphertextBlob field's value. func (s *EncryptOutput) SetCiphertextBlob(v []byte) *EncryptOutput { s.CiphertextBlob = v return s } // SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value. func (s *EncryptOutput) SetEncryptionAlgorithm(v string) *EncryptOutput { s.EncryptionAlgorithm = &v return s } // SetKeyId sets the KeyId field's value. func (s *EncryptOutput) SetKeyId(v string) *EncryptOutput { s.KeyId = &v return s } // The request was rejected because the specified import token is expired. Use // GetParametersForImport to get a new import token and public key, use the // new public key to encrypt the key material, and then try the request again. type ExpiredImportTokenException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ExpiredImportTokenException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ExpiredImportTokenException) GoString() string { return s.String() } func newErrorExpiredImportTokenException(v protocol.ResponseMetadata) error { return &ExpiredImportTokenException{ RespMetadata: v, } } // Code returns the exception type name. func (s *ExpiredImportTokenException) Code() string { return "ExpiredImportTokenException" } // Message returns the exception's message. func (s *ExpiredImportTokenException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *ExpiredImportTokenException) OrigErr() error { return nil } func (s *ExpiredImportTokenException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *ExpiredImportTokenException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *ExpiredImportTokenException) RequestID() string { return s.RespMetadata.RequestID } type GenerateDataKeyInput struct { _ struct{} `type:"structure"` // Checks if your request will succeed. DryRun is an optional parameter. // // To learn more about how to use this parameter, see Testing your KMS API calls // (path_to_url // in the Key Management Service Developer Guide. DryRun *bool `type:"boolean"` // Specifies the encryption context that will be used when encrypting the data // key. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // An encryption context is a collection of non-secret key-value pairs that // represent additional authenticated data. When you use an encryption context // to encrypt data, you must specify the same (an exact case-sensitive match) // encryption context to decrypt the data. An encryption context is supported // only on operations with symmetric encryption KMS keys. On operations with // symmetric encryption KMS keys, an encryption context is optional, but it // is strongly recommended. // // For more information, see Encryption context (path_to_url#encrypt_context) // in the Key Management Service Developer Guide. EncryptionContext map[string]*string `type:"map"` // A list of grant tokens. // // Use a grant token when your permission to call this operation comes from // a new grant that has not yet achieved eventual consistency. For more information, // see Grant token (path_to_url#grant_token) // and Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // Specifies the symmetric encryption KMS key that encrypts the data key. You // cannot specify an asymmetric KMS key or a KMS key in a custom key store. // To get the type and origin of your KMS key, use the DescribeKey operation. // // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. // When using an alias name, prefix it with "alias/". To specify a KMS key in // a different Amazon Web Services account, you must use the key ARN or alias // ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // * Alias name: alias/ExampleAlias // // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // To get the alias name and alias ARN, use ListAliases. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // Specifies the length of the data key. Use AES_128 to generate a 128-bit symmetric // key, or AES_256 to generate a 256-bit symmetric key. // // You must specify either the KeySpec or the NumberOfBytes parameter (but not // both) in every GenerateDataKey request. KeySpec *string `type:"string" enum:"DataKeySpec"` // Specifies the length of the data key in bytes. For example, use the value // 64 to generate a 512-bit data key (64 bytes is 512 bits). For 128-bit (16-byte) // and 256-bit (32-byte) data keys, use the KeySpec parameter. // // You must specify either the KeySpec or the NumberOfBytes parameter (but not // both) in every GenerateDataKey request. NumberOfBytes *int64 `min:"1" type:"integer"` // A signed attestation document (path_to_url#term-attestdoc) // from an Amazon Web Services Nitro enclave and the encryption algorithm to // use with the enclave's public key. The only valid encryption algorithm is // RSAES_OAEP_SHA_256. // // This parameter only supports attestation documents for Amazon Web Services // Nitro Enclaves. To include this parameter, use the Amazon Web Services Nitro // Enclaves SDK (path_to_url#sdk) // or any Amazon Web Services SDK. // // When you use this parameter, instead of returning the plaintext data key, // KMS encrypts the plaintext data key under the public key in the attestation // document, and returns the resulting ciphertext in the CiphertextForRecipient // field in the response. This ciphertext can be decrypted only with the private // key in the enclave. The CiphertextBlob field in the response contains a copy // of the data key encrypted under the KMS key specified by the KeyId parameter. // The Plaintext field in the response is null or empty. // // For information about the interaction between KMS and Amazon Web Services // Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS (path_to_url // in the Key Management Service Developer Guide. Recipient *RecipientInfo `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *GenerateDataKeyInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 { invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1)) } if s.Recipient != nil { if err := s.Recipient.Validate(); err != nil { invalidParams.AddNested("Recipient", err.(request.ErrInvalidParams)) } } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetDryRun sets the DryRun field's value. func (s *GenerateDataKeyInput) SetDryRun(v bool) *GenerateDataKeyInput { s.DryRun = &v return s } // SetEncryptionContext sets the EncryptionContext field's value. func (s *GenerateDataKeyInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyInput { s.EncryptionContext = v return s } // SetGrantTokens sets the GrantTokens field's value. func (s *GenerateDataKeyInput) SetGrantTokens(v []*string) *GenerateDataKeyInput { s.GrantTokens = v return s } // SetKeyId sets the KeyId field's value. func (s *GenerateDataKeyInput) SetKeyId(v string) *GenerateDataKeyInput { s.KeyId = &v return s } // SetKeySpec sets the KeySpec field's value. func (s *GenerateDataKeyInput) SetKeySpec(v string) *GenerateDataKeyInput { s.KeySpec = &v return s } // SetNumberOfBytes sets the NumberOfBytes field's value. func (s *GenerateDataKeyInput) SetNumberOfBytes(v int64) *GenerateDataKeyInput { s.NumberOfBytes = &v return s } // SetRecipient sets the Recipient field's value. func (s *GenerateDataKeyInput) SetRecipient(v *RecipientInfo) *GenerateDataKeyInput { s.Recipient = v return s } type GenerateDataKeyOutput struct { _ struct{} `type:"structure"` // The encrypted copy of the data key. When you use the HTTP API or the Amazon // Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. // CiphertextBlob is automatically base64 encoded/decoded by the SDK. CiphertextBlob []byte `min:"1" type:"blob"` // The plaintext data key encrypted with the public key from the Nitro enclave. // This ciphertext can be decrypted only by using a private key in the Nitro // enclave. // // This field is included in the response only when the Recipient parameter // in the request includes a valid attestation document from an Amazon Web Services // Nitro enclave. For information about the interaction between KMS and Amazon // Web Services Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses // KMS (path_to_url // in the Key Management Service Developer Guide. // CiphertextForRecipient is automatically base64 encoded/decoded by the SDK. CiphertextForRecipient []byte `min:"1" type:"blob"` // The Amazon Resource Name (key ARN (path_to_url#key-id-key-ARN)) // of the KMS key that encrypted the data key. KeyId *string `min:"1" type:"string"` // The plaintext data key. When you use the HTTP API or the Amazon Web Services // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. Use // this data key to encrypt your data outside of KMS. Then, remove it from memory // as soon as possible. // // If the response includes the CiphertextForRecipient field, the Plaintext // field is null or empty. // // Plaintext is a sensitive parameter and its value will be // replaced with "sensitive" in string returned by GenerateDataKeyOutput's // String and GoString methods. // // Plaintext is automatically base64 encoded/decoded by the SDK. Plaintext []byte `min:"1" type:"blob" sensitive:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyOutput) GoString() string { return s.String() } // SetCiphertextBlob sets the CiphertextBlob field's value. func (s *GenerateDataKeyOutput) SetCiphertextBlob(v []byte) *GenerateDataKeyOutput { s.CiphertextBlob = v return s } // SetCiphertextForRecipient sets the CiphertextForRecipient field's value. func (s *GenerateDataKeyOutput) SetCiphertextForRecipient(v []byte) *GenerateDataKeyOutput { s.CiphertextForRecipient = v return s } // SetKeyId sets the KeyId field's value. func (s *GenerateDataKeyOutput) SetKeyId(v string) *GenerateDataKeyOutput { s.KeyId = &v return s } // SetPlaintext sets the Plaintext field's value. func (s *GenerateDataKeyOutput) SetPlaintext(v []byte) *GenerateDataKeyOutput { s.Plaintext = v return s } type GenerateDataKeyPairInput struct { _ struct{} `type:"structure"` // Checks if your request will succeed. DryRun is an optional parameter. // // To learn more about how to use this parameter, see Testing your KMS API calls // (path_to_url // in the Key Management Service Developer Guide. DryRun *bool `type:"boolean"` // Specifies the encryption context that will be used when encrypting the private // key in the data key pair. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // An encryption context is a collection of non-secret key-value pairs that // represent additional authenticated data. When you use an encryption context // to encrypt data, you must specify the same (an exact case-sensitive match) // encryption context to decrypt the data. An encryption context is supported // only on operations with symmetric encryption KMS keys. On operations with // symmetric encryption KMS keys, an encryption context is optional, but it // is strongly recommended. // // For more information, see Encryption context (path_to_url#encrypt_context) // in the Key Management Service Developer Guide. EncryptionContext map[string]*string `type:"map"` // A list of grant tokens. // // Use a grant token when your permission to call this operation comes from // a new grant that has not yet achieved eventual consistency. For more information, // see Grant token (path_to_url#grant_token) // and Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // Specifies the symmetric encryption KMS key that encrypts the private key // in the data key pair. You cannot specify an asymmetric KMS key or a KMS key // in a custom key store. To get the type and origin of your KMS key, use the // DescribeKey operation. // // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. // When using an alias name, prefix it with "alias/". To specify a KMS key in // a different Amazon Web Services account, you must use the key ARN or alias // ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // * Alias name: alias/ExampleAlias // // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // To get the alias name and alias ARN, use ListAliases. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // Determines the type of data key pair that is generated. // // The KMS rule that restricts the use of asymmetric RSA and SM2 KMS keys to // encrypt and decrypt or to sign and verify (but not both), and the rule that // permits you to use ECC KMS keys only to sign and verify, are not effective // on data key pairs, which are used outside of KMS. The SM2 key spec is only // available in China Regions. // // KeyPairSpec is a required field KeyPairSpec *string `type:"string" required:"true" enum:"DataKeyPairSpec"` // A signed attestation document (path_to_url#term-attestdoc) // from an Amazon Web Services Nitro enclave and the encryption algorithm to // use with the enclave's public key. The only valid encryption algorithm is // RSAES_OAEP_SHA_256. // // This parameter only supports attestation documents for Amazon Web Services // Nitro Enclaves. To include this parameter, use the Amazon Web Services Nitro // Enclaves SDK (path_to_url#sdk) // or any Amazon Web Services SDK. // // When you use this parameter, instead of returning a plaintext copy of the // private data key, KMS encrypts the plaintext private data key under the public // key in the attestation document, and returns the resulting ciphertext in // the CiphertextForRecipient field in the response. This ciphertext can be // decrypted only with the private key in the enclave. The CiphertextBlob field // in the response contains a copy of the private data key encrypted under the // KMS key specified by the KeyId parameter. The PrivateKeyPlaintext field in // the response is null or empty. // // For information about the interaction between KMS and Amazon Web Services // Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS (path_to_url // in the Key Management Service Developer Guide. Recipient *RecipientInfo `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyPairInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyPairInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *GenerateDataKeyPairInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyPairInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.KeyPairSpec == nil { invalidParams.Add(request.NewErrParamRequired("KeyPairSpec")) } if s.Recipient != nil { if err := s.Recipient.Validate(); err != nil { invalidParams.AddNested("Recipient", err.(request.ErrInvalidParams)) } } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetDryRun sets the DryRun field's value. func (s *GenerateDataKeyPairInput) SetDryRun(v bool) *GenerateDataKeyPairInput { s.DryRun = &v return s } // SetEncryptionContext sets the EncryptionContext field's value. func (s *GenerateDataKeyPairInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyPairInput { s.EncryptionContext = v return s } // SetGrantTokens sets the GrantTokens field's value. func (s *GenerateDataKeyPairInput) SetGrantTokens(v []*string) *GenerateDataKeyPairInput { s.GrantTokens = v return s } // SetKeyId sets the KeyId field's value. func (s *GenerateDataKeyPairInput) SetKeyId(v string) *GenerateDataKeyPairInput { s.KeyId = &v return s } // SetKeyPairSpec sets the KeyPairSpec field's value. func (s *GenerateDataKeyPairInput) SetKeyPairSpec(v string) *GenerateDataKeyPairInput { s.KeyPairSpec = &v return s } // SetRecipient sets the Recipient field's value. func (s *GenerateDataKeyPairInput) SetRecipient(v *RecipientInfo) *GenerateDataKeyPairInput { s.Recipient = v return s } type GenerateDataKeyPairOutput struct { _ struct{} `type:"structure"` // The plaintext private data key encrypted with the public key from the Nitro // enclave. This ciphertext can be decrypted only by using a private key in // the Nitro enclave. // // This field is included in the response only when the Recipient parameter // in the request includes a valid attestation document from an Amazon Web Services // Nitro enclave. For information about the interaction between KMS and Amazon // Web Services Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses // KMS (path_to_url // in the Key Management Service Developer Guide. // CiphertextForRecipient is automatically base64 encoded/decoded by the SDK. CiphertextForRecipient []byte `min:"1" type:"blob"` // The Amazon Resource Name (key ARN (path_to_url#key-id-key-ARN)) // of the KMS key that encrypted the private key. KeyId *string `min:"1" type:"string"` // The type of data key pair that was generated. KeyPairSpec *string `type:"string" enum:"DataKeyPairSpec"` // The encrypted copy of the private key. When you use the HTTP API or the Amazon // Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. // PrivateKeyCiphertextBlob is automatically base64 encoded/decoded by the SDK. PrivateKeyCiphertextBlob []byte `min:"1" type:"blob"` // The plaintext copy of the private key. When you use the HTTP API or the Amazon // Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. // // If the response includes the CiphertextForRecipient field, the PrivateKeyPlaintext // field is null or empty. // // PrivateKeyPlaintext is a sensitive parameter and its value will be // replaced with "sensitive" in string returned by GenerateDataKeyPairOutput's // String and GoString methods. // // PrivateKeyPlaintext is automatically base64 encoded/decoded by the SDK. PrivateKeyPlaintext []byte `min:"1" type:"blob" sensitive:"true"` // The public key (in plaintext). When you use the HTTP API or the Amazon Web // Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. // PublicKey is automatically base64 encoded/decoded by the SDK. PublicKey []byte `min:"1" type:"blob"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyPairOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyPairOutput) GoString() string { return s.String() } // SetCiphertextForRecipient sets the CiphertextForRecipient field's value. func (s *GenerateDataKeyPairOutput) SetCiphertextForRecipient(v []byte) *GenerateDataKeyPairOutput { s.CiphertextForRecipient = v return s } // SetKeyId sets the KeyId field's value. func (s *GenerateDataKeyPairOutput) SetKeyId(v string) *GenerateDataKeyPairOutput { s.KeyId = &v return s } // SetKeyPairSpec sets the KeyPairSpec field's value. func (s *GenerateDataKeyPairOutput) SetKeyPairSpec(v string) *GenerateDataKeyPairOutput { s.KeyPairSpec = &v return s } // SetPrivateKeyCiphertextBlob sets the PrivateKeyCiphertextBlob field's value. func (s *GenerateDataKeyPairOutput) SetPrivateKeyCiphertextBlob(v []byte) *GenerateDataKeyPairOutput { s.PrivateKeyCiphertextBlob = v return s } // SetPrivateKeyPlaintext sets the PrivateKeyPlaintext field's value. func (s *GenerateDataKeyPairOutput) SetPrivateKeyPlaintext(v []byte) *GenerateDataKeyPairOutput { s.PrivateKeyPlaintext = v return s } // SetPublicKey sets the PublicKey field's value. func (s *GenerateDataKeyPairOutput) SetPublicKey(v []byte) *GenerateDataKeyPairOutput { s.PublicKey = v return s } type GenerateDataKeyPairWithoutPlaintextInput struct { _ struct{} `type:"structure"` // Checks if your request will succeed. DryRun is an optional parameter. // // To learn more about how to use this parameter, see Testing your KMS API calls // (path_to_url // in the Key Management Service Developer Guide. DryRun *bool `type:"boolean"` // Specifies the encryption context that will be used when encrypting the private // key in the data key pair. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // An encryption context is a collection of non-secret key-value pairs that // represent additional authenticated data. When you use an encryption context // to encrypt data, you must specify the same (an exact case-sensitive match) // encryption context to decrypt the data. An encryption context is supported // only on operations with symmetric encryption KMS keys. On operations with // symmetric encryption KMS keys, an encryption context is optional, but it // is strongly recommended. // // For more information, see Encryption context (path_to_url#encrypt_context) // in the Key Management Service Developer Guide. EncryptionContext map[string]*string `type:"map"` // A list of grant tokens. // // Use a grant token when your permission to call this operation comes from // a new grant that has not yet achieved eventual consistency. For more information, // see Grant token (path_to_url#grant_token) // and Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // Specifies the symmetric encryption KMS key that encrypts the private key // in the data key pair. You cannot specify an asymmetric KMS key or a KMS key // in a custom key store. To get the type and origin of your KMS key, use the // DescribeKey operation. // // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. // When using an alias name, prefix it with "alias/". To specify a KMS key in // a different Amazon Web Services account, you must use the key ARN or alias // ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // * Alias name: alias/ExampleAlias // // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // To get the alias name and alias ARN, use ListAliases. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // Determines the type of data key pair that is generated. // // The KMS rule that restricts the use of asymmetric RSA and SM2 KMS keys to // encrypt and decrypt or to sign and verify (but not both), and the rule that // permits you to use ECC KMS keys only to sign and verify, are not effective // on data key pairs, which are used outside of KMS. The SM2 key spec is only // available in China Regions. // // KeyPairSpec is a required field KeyPairSpec *string `type:"string" required:"true" enum:"DataKeyPairSpec"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyPairWithoutPlaintextInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyPairWithoutPlaintextInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *GenerateDataKeyPairWithoutPlaintextInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyPairWithoutPlaintextInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.KeyPairSpec == nil { invalidParams.Add(request.NewErrParamRequired("KeyPairSpec")) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetDryRun sets the DryRun field's value. func (s *GenerateDataKeyPairWithoutPlaintextInput) SetDryRun(v bool) *GenerateDataKeyPairWithoutPlaintextInput { s.DryRun = &v return s } // SetEncryptionContext sets the EncryptionContext field's value. func (s *GenerateDataKeyPairWithoutPlaintextInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyPairWithoutPlaintextInput { s.EncryptionContext = v return s } // SetGrantTokens sets the GrantTokens field's value. func (s *GenerateDataKeyPairWithoutPlaintextInput) SetGrantTokens(v []*string) *GenerateDataKeyPairWithoutPlaintextInput { s.GrantTokens = v return s } // SetKeyId sets the KeyId field's value. func (s *GenerateDataKeyPairWithoutPlaintextInput) SetKeyId(v string) *GenerateDataKeyPairWithoutPlaintextInput { s.KeyId = &v return s } // SetKeyPairSpec sets the KeyPairSpec field's value. func (s *GenerateDataKeyPairWithoutPlaintextInput) SetKeyPairSpec(v string) *GenerateDataKeyPairWithoutPlaintextInput { s.KeyPairSpec = &v return s } type GenerateDataKeyPairWithoutPlaintextOutput struct { _ struct{} `type:"structure"` // The Amazon Resource Name (key ARN (path_to_url#key-id-key-ARN)) // of the KMS key that encrypted the private key. KeyId *string `min:"1" type:"string"` // The type of data key pair that was generated. KeyPairSpec *string `type:"string" enum:"DataKeyPairSpec"` // The encrypted copy of the private key. When you use the HTTP API or the Amazon // Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. // PrivateKeyCiphertextBlob is automatically base64 encoded/decoded by the SDK. PrivateKeyCiphertextBlob []byte `min:"1" type:"blob"` // The public key (in plaintext). When you use the HTTP API or the Amazon Web // Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. // PublicKey is automatically base64 encoded/decoded by the SDK. PublicKey []byte `min:"1" type:"blob"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyPairWithoutPlaintextOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyPairWithoutPlaintextOutput) GoString() string { return s.String() } // SetKeyId sets the KeyId field's value. func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetKeyId(v string) *GenerateDataKeyPairWithoutPlaintextOutput { s.KeyId = &v return s } // SetKeyPairSpec sets the KeyPairSpec field's value. func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetKeyPairSpec(v string) *GenerateDataKeyPairWithoutPlaintextOutput { s.KeyPairSpec = &v return s } // SetPrivateKeyCiphertextBlob sets the PrivateKeyCiphertextBlob field's value. func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetPrivateKeyCiphertextBlob(v []byte) *GenerateDataKeyPairWithoutPlaintextOutput { s.PrivateKeyCiphertextBlob = v return s } // SetPublicKey sets the PublicKey field's value. func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetPublicKey(v []byte) *GenerateDataKeyPairWithoutPlaintextOutput { s.PublicKey = v return s } type GenerateDataKeyWithoutPlaintextInput struct { _ struct{} `type:"structure"` // Checks if your request will succeed. DryRun is an optional parameter. // // To learn more about how to use this parameter, see Testing your KMS API calls // (path_to_url // in the Key Management Service Developer Guide. DryRun *bool `type:"boolean"` // Specifies the encryption context that will be used when encrypting the data // key. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // An encryption context is a collection of non-secret key-value pairs that // represent additional authenticated data. When you use an encryption context // to encrypt data, you must specify the same (an exact case-sensitive match) // encryption context to decrypt the data. An encryption context is supported // only on operations with symmetric encryption KMS keys. On operations with // symmetric encryption KMS keys, an encryption context is optional, but it // is strongly recommended. // // For more information, see Encryption context (path_to_url#encrypt_context) // in the Key Management Service Developer Guide. EncryptionContext map[string]*string `type:"map"` // A list of grant tokens. // // Use a grant token when your permission to call this operation comes from // a new grant that has not yet achieved eventual consistency. For more information, // see Grant token (path_to_url#grant_token) // and Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // Specifies the symmetric encryption KMS key that encrypts the data key. You // cannot specify an asymmetric KMS key or a KMS key in a custom key store. // To get the type and origin of your KMS key, use the DescribeKey operation. // // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. // When using an alias name, prefix it with "alias/". To specify a KMS key in // a different Amazon Web Services account, you must use the key ARN or alias // ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // * Alias name: alias/ExampleAlias // // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // To get the alias name and alias ARN, use ListAliases. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // The length of the data key. Use AES_128 to generate a 128-bit symmetric key, // or AES_256 to generate a 256-bit symmetric key. KeySpec *string `type:"string" enum:"DataKeySpec"` // The length of the data key in bytes. For example, use the value 64 to generate // a 512-bit data key (64 bytes is 512 bits). For common key lengths (128-bit // and 256-bit symmetric keys), we recommend that you use the KeySpec field // instead of this one. NumberOfBytes *int64 `min:"1" type:"integer"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyWithoutPlaintextInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyWithoutPlaintextInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *GenerateDataKeyWithoutPlaintextInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyWithoutPlaintextInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 { invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetDryRun sets the DryRun field's value. func (s *GenerateDataKeyWithoutPlaintextInput) SetDryRun(v bool) *GenerateDataKeyWithoutPlaintextInput { s.DryRun = &v return s } // SetEncryptionContext sets the EncryptionContext field's value. func (s *GenerateDataKeyWithoutPlaintextInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyWithoutPlaintextInput { s.EncryptionContext = v return s } // SetGrantTokens sets the GrantTokens field's value. func (s *GenerateDataKeyWithoutPlaintextInput) SetGrantTokens(v []*string) *GenerateDataKeyWithoutPlaintextInput { s.GrantTokens = v return s } // SetKeyId sets the KeyId field's value. func (s *GenerateDataKeyWithoutPlaintextInput) SetKeyId(v string) *GenerateDataKeyWithoutPlaintextInput { s.KeyId = &v return s } // SetKeySpec sets the KeySpec field's value. func (s *GenerateDataKeyWithoutPlaintextInput) SetKeySpec(v string) *GenerateDataKeyWithoutPlaintextInput { s.KeySpec = &v return s } // SetNumberOfBytes sets the NumberOfBytes field's value. func (s *GenerateDataKeyWithoutPlaintextInput) SetNumberOfBytes(v int64) *GenerateDataKeyWithoutPlaintextInput { s.NumberOfBytes = &v return s } type GenerateDataKeyWithoutPlaintextOutput struct { _ struct{} `type:"structure"` // The encrypted data key. When you use the HTTP API or the Amazon Web Services // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. // CiphertextBlob is automatically base64 encoded/decoded by the SDK. CiphertextBlob []byte `min:"1" type:"blob"` // The Amazon Resource Name (key ARN (path_to_url#key-id-key-ARN)) // of the KMS key that encrypted the data key. KeyId *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyWithoutPlaintextOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateDataKeyWithoutPlaintextOutput) GoString() string { return s.String() } // SetCiphertextBlob sets the CiphertextBlob field's value. func (s *GenerateDataKeyWithoutPlaintextOutput) SetCiphertextBlob(v []byte) *GenerateDataKeyWithoutPlaintextOutput { s.CiphertextBlob = v return s } // SetKeyId sets the KeyId field's value. func (s *GenerateDataKeyWithoutPlaintextOutput) SetKeyId(v string) *GenerateDataKeyWithoutPlaintextOutput { s.KeyId = &v return s } type GenerateMacInput struct { _ struct{} `type:"structure"` // Checks if your request will succeed. DryRun is an optional parameter. // // To learn more about how to use this parameter, see Testing your KMS API calls // (path_to_url // in the Key Management Service Developer Guide. DryRun *bool `type:"boolean"` // A list of grant tokens. // // Use a grant token when your permission to call this operation comes from // a new grant that has not yet achieved eventual consistency. For more information, // see Grant token (path_to_url#grant_token) // and Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // The HMAC KMS key to use in the operation. The MAC algorithm computes the // HMAC for the message and the key as described in RFC 2104 (path_to_url // // To identify an HMAC KMS key, use the DescribeKey operation and see the KeySpec // field in the response. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // The MAC algorithm used in the operation. // // The algorithm must be compatible with the HMAC KMS key that you specify. // To find the MAC algorithms that your HMAC KMS key supports, use the DescribeKey // operation and see the MacAlgorithms field in the DescribeKey response. // // MacAlgorithm is a required field MacAlgorithm *string `type:"string" required:"true" enum:"MacAlgorithmSpec"` // The message to be hashed. Specify a message of up to 4,096 bytes. // // GenerateMac and VerifyMac do not provide special handling for message digests. // If you generate an HMAC for a hash digest of a message, you must verify the // HMAC of the same hash digest. // // Message is a sensitive parameter and its value will be // replaced with "sensitive" in string returned by GenerateMacInput's // String and GoString methods. // // Message is automatically base64 encoded/decoded by the SDK. // // Message is a required field Message []byte `min:"1" type:"blob" required:"true" sensitive:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateMacInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateMacInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *GenerateMacInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "GenerateMacInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.MacAlgorithm == nil { invalidParams.Add(request.NewErrParamRequired("MacAlgorithm")) } if s.Message == nil { invalidParams.Add(request.NewErrParamRequired("Message")) } if s.Message != nil && len(s.Message) < 1 { invalidParams.Add(request.NewErrParamMinLen("Message", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetDryRun sets the DryRun field's value. func (s *GenerateMacInput) SetDryRun(v bool) *GenerateMacInput { s.DryRun = &v return s } // SetGrantTokens sets the GrantTokens field's value. func (s *GenerateMacInput) SetGrantTokens(v []*string) *GenerateMacInput { s.GrantTokens = v return s } // SetKeyId sets the KeyId field's value. func (s *GenerateMacInput) SetKeyId(v string) *GenerateMacInput { s.KeyId = &v return s } // SetMacAlgorithm sets the MacAlgorithm field's value. func (s *GenerateMacInput) SetMacAlgorithm(v string) *GenerateMacInput { s.MacAlgorithm = &v return s } // SetMessage sets the Message field's value. func (s *GenerateMacInput) SetMessage(v []byte) *GenerateMacInput { s.Message = v return s } type GenerateMacOutput struct { _ struct{} `type:"structure"` // The HMAC KMS key used in the operation. KeyId *string `min:"1" type:"string"` // The hash-based message authentication code (HMAC) that was generated for // the specified message, HMAC KMS key, and MAC algorithm. // // This is the standard, raw HMAC defined in RFC 2104 (path_to_url // Mac is automatically base64 encoded/decoded by the SDK. Mac []byte `min:"1" type:"blob"` // The MAC algorithm that was used to generate the HMAC. MacAlgorithm *string `type:"string" enum:"MacAlgorithmSpec"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateMacOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateMacOutput) GoString() string { return s.String() } // SetKeyId sets the KeyId field's value. func (s *GenerateMacOutput) SetKeyId(v string) *GenerateMacOutput { s.KeyId = &v return s } // SetMac sets the Mac field's value. func (s *GenerateMacOutput) SetMac(v []byte) *GenerateMacOutput { s.Mac = v return s } // SetMacAlgorithm sets the MacAlgorithm field's value. func (s *GenerateMacOutput) SetMacAlgorithm(v string) *GenerateMacOutput { s.MacAlgorithm = &v return s } type GenerateRandomInput struct { _ struct{} `type:"structure"` // Generates the random byte string in the CloudHSM cluster that is associated // with the specified CloudHSM key store. To find the ID of a custom key store, // use the DescribeCustomKeyStores operation. // // External key store IDs are not valid for this parameter. If you specify the // ID of an external key store, GenerateRandom throws an UnsupportedOperationException. CustomKeyStoreId *string `min:"1" type:"string"` // The length of the random byte string. This parameter is required. NumberOfBytes *int64 `min:"1" type:"integer"` // A signed attestation document (path_to_url#term-attestdoc) // from an Amazon Web Services Nitro enclave and the encryption algorithm to // use with the enclave's public key. The only valid encryption algorithm is // RSAES_OAEP_SHA_256. // // This parameter only supports attestation documents for Amazon Web Services // Nitro Enclaves. To include this parameter, use the Amazon Web Services Nitro // Enclaves SDK (path_to_url#sdk) // or any Amazon Web Services SDK. // // When you use this parameter, instead of returning plaintext bytes, KMS encrypts // the plaintext bytes under the public key in the attestation document, and // returns the resulting ciphertext in the CiphertextForRecipient field in the // response. This ciphertext can be decrypted only with the private key in the // enclave. The Plaintext field in the response is null or empty. // // For information about the interaction between KMS and Amazon Web Services // Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS (path_to_url // in the Key Management Service Developer Guide. Recipient *RecipientInfo `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateRandomInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateRandomInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *GenerateRandomInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "GenerateRandomInput"} if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) } if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 { invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1)) } if s.Recipient != nil { if err := s.Recipient.Validate(); err != nil { invalidParams.AddNested("Recipient", err.(request.ErrInvalidParams)) } } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. func (s *GenerateRandomInput) SetCustomKeyStoreId(v string) *GenerateRandomInput { s.CustomKeyStoreId = &v return s } // SetNumberOfBytes sets the NumberOfBytes field's value. func (s *GenerateRandomInput) SetNumberOfBytes(v int64) *GenerateRandomInput { s.NumberOfBytes = &v return s } // SetRecipient sets the Recipient field's value. func (s *GenerateRandomInput) SetRecipient(v *RecipientInfo) *GenerateRandomInput { s.Recipient = v return s } type GenerateRandomOutput struct { _ struct{} `type:"structure"` // The plaintext random bytes encrypted with the public key from the Nitro enclave. // This ciphertext can be decrypted only by using a private key in the Nitro // enclave. // // This field is included in the response only when the Recipient parameter // in the request includes a valid attestation document from an Amazon Web Services // Nitro enclave. For information about the interaction between KMS and Amazon // Web Services Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses // KMS (path_to_url // in the Key Management Service Developer Guide. // CiphertextForRecipient is automatically base64 encoded/decoded by the SDK. CiphertextForRecipient []byte `min:"1" type:"blob"` // The random byte string. When you use the HTTP API or the Amazon Web Services // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. // // If the response includes the CiphertextForRecipient field, the Plaintext // field is null or empty. // // Plaintext is a sensitive parameter and its value will be // replaced with "sensitive" in string returned by GenerateRandomOutput's // String and GoString methods. // // Plaintext is automatically base64 encoded/decoded by the SDK. Plaintext []byte `min:"1" type:"blob" sensitive:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateRandomOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GenerateRandomOutput) GoString() string { return s.String() } // SetCiphertextForRecipient sets the CiphertextForRecipient field's value. func (s *GenerateRandomOutput) SetCiphertextForRecipient(v []byte) *GenerateRandomOutput { s.CiphertextForRecipient = v return s } // SetPlaintext sets the Plaintext field's value. func (s *GenerateRandomOutput) SetPlaintext(v []byte) *GenerateRandomOutput { s.Plaintext = v return s } type GetKeyPolicyInput struct { _ struct{} `type:"structure"` // Gets the key policy for the specified KMS key. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // Specifies the name of the key policy. If no policy name is specified, the // default value is default. The only valid name is default. To get the names // of key policies, use ListKeyPolicies. PolicyName *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetKeyPolicyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetKeyPolicyInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *GetKeyPolicyInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "GetKeyPolicyInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.PolicyName != nil && len(*s.PolicyName) < 1 { invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *GetKeyPolicyInput) SetKeyId(v string) *GetKeyPolicyInput { s.KeyId = &v return s } // SetPolicyName sets the PolicyName field's value. func (s *GetKeyPolicyInput) SetPolicyName(v string) *GetKeyPolicyInput { s.PolicyName = &v return s } type GetKeyPolicyOutput struct { _ struct{} `type:"structure"` // A key policy document in JSON format. Policy *string `min:"1" type:"string"` // The name of the key policy. The only valid value is default. PolicyName *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetKeyPolicyOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetKeyPolicyOutput) GoString() string { return s.String() } // SetPolicy sets the Policy field's value. func (s *GetKeyPolicyOutput) SetPolicy(v string) *GetKeyPolicyOutput { s.Policy = &v return s } // SetPolicyName sets the PolicyName field's value. func (s *GetKeyPolicyOutput) SetPolicyName(v string) *GetKeyPolicyOutput { s.PolicyName = &v return s } type GetKeyRotationStatusInput struct { _ struct{} `type:"structure"` // Gets the rotation status for the specified KMS key. // // Specify the key ID or key ARN of the KMS key. To specify a KMS key in a different // Amazon Web Services account, you must use the key ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetKeyRotationStatusInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetKeyRotationStatusInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *GetKeyRotationStatusInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "GetKeyRotationStatusInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *GetKeyRotationStatusInput) SetKeyId(v string) *GetKeyRotationStatusInput { s.KeyId = &v return s } type GetKeyRotationStatusOutput struct { _ struct{} `type:"structure"` // A Boolean value that specifies whether key rotation is enabled. KeyRotationEnabled *bool `type:"boolean"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetKeyRotationStatusOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetKeyRotationStatusOutput) GoString() string { return s.String() } // SetKeyRotationEnabled sets the KeyRotationEnabled field's value. func (s *GetKeyRotationStatusOutput) SetKeyRotationEnabled(v bool) *GetKeyRotationStatusOutput { s.KeyRotationEnabled = &v return s } type GetParametersForImportInput struct { _ struct{} `type:"structure"` // The identifier of the KMS key that will be associated with the imported key // material. The Origin of the KMS key must be EXTERNAL. // // All KMS key types are supported, including multi-Region keys. However, you // cannot import key material into a KMS key in a custom key store. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // The algorithm you will use with the RSA public key (PublicKey) in the response // to protect your key material during import. For more information, see Select // a wrapping algorithm (kms/latest/developerguide/importing-keys-get-public-key-and-token.html#select-wrapping-algorithm) // in the Key Management Service Developer Guide. // // For RSA_AES wrapping algorithms, you encrypt your key material with an AES // key that you generate, then encrypt your AES key with the RSA public key // from KMS. For RSAES wrapping algorithms, you encrypt your key material directly // with the RSA public key from KMS. // // The wrapping algorithms that you can use depend on the type of key material // that you are importing. To import an RSA private key, you must use an RSA_AES // wrapping algorithm. // // * RSA_AES_KEY_WRAP_SHA_256 Supported for wrapping RSA and ECC key // material. // // * RSA_AES_KEY_WRAP_SHA_1 Supported for wrapping RSA and ECC key material. // // * RSAES_OAEP_SHA_256 Supported for all types of key material, except // RSA key material (private key). You cannot use the RSAES_OAEP_SHA_256 // wrapping algorithm with the RSA_2048 wrapping key spec to wrap ECC_NIST_P521 // key material. // // * RSAES_OAEP_SHA_1 Supported for all types of key material, except // RSA key material (private key). You cannot use the RSAES_OAEP_SHA_1 wrapping // algorithm with the RSA_2048 wrapping key spec to wrap ECC_NIST_P521 key // material. // // * RSAES_PKCS1_V1_5 (Deprecated) As of October 10, 2023, KMS does not // support the RSAES_PKCS1_V1_5 wrapping algorithm. // // WrappingAlgorithm is a required field WrappingAlgorithm *string `type:"string" required:"true" enum:"AlgorithmSpec"` // The type of RSA public key to return in the response. You will use this wrapping // key with the specified wrapping algorithm to protect your key material during // import. // // Use the longest RSA wrapping key that is practical. // // You cannot use an RSA_2048 public key to directly wrap an ECC_NIST_P521 private // key. Instead, use an RSA_AES wrapping algorithm or choose a longer RSA public // key. // // WrappingKeySpec is a required field WrappingKeySpec *string `type:"string" required:"true" enum:"WrappingKeySpec"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetParametersForImportInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetParametersForImportInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *GetParametersForImportInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "GetParametersForImportInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.WrappingAlgorithm == nil { invalidParams.Add(request.NewErrParamRequired("WrappingAlgorithm")) } if s.WrappingKeySpec == nil { invalidParams.Add(request.NewErrParamRequired("WrappingKeySpec")) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *GetParametersForImportInput) SetKeyId(v string) *GetParametersForImportInput { s.KeyId = &v return s } // SetWrappingAlgorithm sets the WrappingAlgorithm field's value. func (s *GetParametersForImportInput) SetWrappingAlgorithm(v string) *GetParametersForImportInput { s.WrappingAlgorithm = &v return s } // SetWrappingKeySpec sets the WrappingKeySpec field's value. func (s *GetParametersForImportInput) SetWrappingKeySpec(v string) *GetParametersForImportInput { s.WrappingKeySpec = &v return s } type GetParametersForImportOutput struct { _ struct{} `type:"structure"` // The import token to send in a subsequent ImportKeyMaterial request. // ImportToken is automatically base64 encoded/decoded by the SDK. ImportToken []byte `min:"1" type:"blob"` // The Amazon Resource Name (key ARN (path_to_url#key-id-key-ARN)) // of the KMS key to use in a subsequent ImportKeyMaterial request. This is // the same KMS key specified in the GetParametersForImport request. KeyId *string `min:"1" type:"string"` // The time at which the import token and public key are no longer valid. After // this time, you cannot use them to make an ImportKeyMaterial request and you // must send another GetParametersForImport request to get new ones. ParametersValidTo *time.Time `type:"timestamp"` // The public key to use to encrypt the key material before importing it with // ImportKeyMaterial. // // PublicKey is a sensitive parameter and its value will be // replaced with "sensitive" in string returned by GetParametersForImportOutput's // String and GoString methods. // // PublicKey is automatically base64 encoded/decoded by the SDK. PublicKey []byte `min:"1" type:"blob" sensitive:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetParametersForImportOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetParametersForImportOutput) GoString() string { return s.String() } // SetImportToken sets the ImportToken field's value. func (s *GetParametersForImportOutput) SetImportToken(v []byte) *GetParametersForImportOutput { s.ImportToken = v return s } // SetKeyId sets the KeyId field's value. func (s *GetParametersForImportOutput) SetKeyId(v string) *GetParametersForImportOutput { s.KeyId = &v return s } // SetParametersValidTo sets the ParametersValidTo field's value. func (s *GetParametersForImportOutput) SetParametersValidTo(v time.Time) *GetParametersForImportOutput { s.ParametersValidTo = &v return s } // SetPublicKey sets the PublicKey field's value. func (s *GetParametersForImportOutput) SetPublicKey(v []byte) *GetParametersForImportOutput { s.PublicKey = v return s } type GetPublicKeyInput struct { _ struct{} `type:"structure"` // A list of grant tokens. // // Use a grant token when your permission to call this operation comes from // a new grant that has not yet achieved eventual consistency. For more information, // see Grant token (path_to_url#grant_token) // and Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // Identifies the asymmetric KMS key that includes the public key. // // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. // When using an alias name, prefix it with "alias/". To specify a KMS key in // a different Amazon Web Services account, you must use the key ARN or alias // ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // * Alias name: alias/ExampleAlias // // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // To get the alias name and alias ARN, use ListAliases. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetPublicKeyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetPublicKeyInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *GetPublicKeyInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "GetPublicKeyInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetGrantTokens sets the GrantTokens field's value. func (s *GetPublicKeyInput) SetGrantTokens(v []*string) *GetPublicKeyInput { s.GrantTokens = v return s } // SetKeyId sets the KeyId field's value. func (s *GetPublicKeyInput) SetKeyId(v string) *GetPublicKeyInput { s.KeyId = &v return s } type GetPublicKeyOutput struct { _ struct{} `type:"structure"` // Instead, use the KeySpec field in the GetPublicKey response. // // The KeySpec and CustomerMasterKeySpec fields have the same value. We recommend // that you use the KeySpec field in your code. However, to avoid breaking changes, // KMS supports both fields. // // Deprecated: This field has been deprecated. Instead, use the KeySpec field. CustomerMasterKeySpec *string `deprecated:"true" type:"string" enum:"CustomerMasterKeySpec"` // The encryption algorithms that KMS supports for this key. // // This information is critical. If a public key encrypts data outside of KMS // by using an unsupported encryption algorithm, the ciphertext cannot be decrypted. // // This field appears in the response only when the KeyUsage of the public key // is ENCRYPT_DECRYPT. EncryptionAlgorithms []*string `type:"list" enum:"EncryptionAlgorithmSpec"` // The Amazon Resource Name (key ARN (path_to_url#key-id-key-ARN)) // of the asymmetric KMS key from which the public key was downloaded. KeyId *string `min:"1" type:"string"` // The type of the of the public key that was downloaded. KeySpec *string `type:"string" enum:"KeySpec"` // The permitted use of the public key. Valid values are ENCRYPT_DECRYPT or // SIGN_VERIFY. // // This information is critical. If a public key with SIGN_VERIFY key usage // encrypts data outside of KMS, the ciphertext cannot be decrypted. KeyUsage *string `type:"string" enum:"KeyUsageType"` // The exported public key. // // The value is a DER-encoded X.509 public key, also known as SubjectPublicKeyInfo // (SPKI), as defined in RFC 5280 (path_to_url When // you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. // Otherwise, it is not Base64-encoded. // PublicKey is automatically base64 encoded/decoded by the SDK. PublicKey []byte `min:"1" type:"blob"` // The signing algorithms that KMS supports for this key. // // This field appears in the response only when the KeyUsage of the public key // is SIGN_VERIFY. SigningAlgorithms []*string `type:"list" enum:"SigningAlgorithmSpec"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetPublicKeyOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetPublicKeyOutput) GoString() string { return s.String() } // SetCustomerMasterKeySpec sets the CustomerMasterKeySpec field's value. func (s *GetPublicKeyOutput) SetCustomerMasterKeySpec(v string) *GetPublicKeyOutput { s.CustomerMasterKeySpec = &v return s } // SetEncryptionAlgorithms sets the EncryptionAlgorithms field's value. func (s *GetPublicKeyOutput) SetEncryptionAlgorithms(v []*string) *GetPublicKeyOutput { s.EncryptionAlgorithms = v return s } // SetKeyId sets the KeyId field's value. func (s *GetPublicKeyOutput) SetKeyId(v string) *GetPublicKeyOutput { s.KeyId = &v return s } // SetKeySpec sets the KeySpec field's value. func (s *GetPublicKeyOutput) SetKeySpec(v string) *GetPublicKeyOutput { s.KeySpec = &v return s } // SetKeyUsage sets the KeyUsage field's value. func (s *GetPublicKeyOutput) SetKeyUsage(v string) *GetPublicKeyOutput { s.KeyUsage = &v return s } // SetPublicKey sets the PublicKey field's value. func (s *GetPublicKeyOutput) SetPublicKey(v []byte) *GetPublicKeyOutput { s.PublicKey = v return s } // SetSigningAlgorithms sets the SigningAlgorithms field's value. func (s *GetPublicKeyOutput) SetSigningAlgorithms(v []*string) *GetPublicKeyOutput { s.SigningAlgorithms = v return s } // Use this structure to allow cryptographic operations (path_to_url#cryptographic-operations) // in the grant only when the operation request includes the specified encryption // context (path_to_url#encrypt_context). // // KMS applies the grant constraints only to cryptographic operations that support // an encryption context, that is, all cryptographic operations with a symmetric // KMS key (path_to_url#symmetric-cmks). // Grant constraints are not applied to operations that do not support an encryption // context, such as cryptographic operations with asymmetric KMS keys and management // operations, such as DescribeKey or RetireGrant. // // In a cryptographic operation, the encryption context in the decryption operation // must be an exact, case-sensitive match for the keys and values in the encryption // context of the encryption operation. Only the order of the pairs can vary. // // However, in a grant constraint, the key in each key-value pair is not case // sensitive, but the value is case sensitive. // // To avoid confusion, do not use multiple encryption context pairs that differ // only by case. To require a fully case-sensitive encryption context, use the // kms:EncryptionContext: and kms:EncryptionContextKeys conditions in an IAM // or key policy. For details, see kms:EncryptionContext: (path_to_url#conditions-kms-encryption-context) // in the Key Management Service Developer Guide . type GrantConstraints struct { _ struct{} `type:"structure"` // A list of key-value pairs that must match the encryption context in the cryptographic // operation (path_to_url#cryptographic-operations) // request. The grant allows the operation only when the encryption context // in the request is the same as the encryption context specified in this constraint. EncryptionContextEquals map[string]*string `type:"map"` // A list of key-value pairs that must be included in the encryption context // of the cryptographic operation (path_to_url#cryptographic-operations) // request. The grant allows the cryptographic operation only when the encryption // context in the request includes the key-value pairs specified in this constraint, // although it can include additional key-value pairs. EncryptionContextSubset map[string]*string `type:"map"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GrantConstraints) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GrantConstraints) GoString() string { return s.String() } // SetEncryptionContextEquals sets the EncryptionContextEquals field's value. func (s *GrantConstraints) SetEncryptionContextEquals(v map[string]*string) *GrantConstraints { s.EncryptionContextEquals = v return s } // SetEncryptionContextSubset sets the EncryptionContextSubset field's value. func (s *GrantConstraints) SetEncryptionContextSubset(v map[string]*string) *GrantConstraints { s.EncryptionContextSubset = v return s } // Contains information about a grant. type GrantListEntry struct { _ struct{} `type:"structure"` // A list of key-value pairs that must be present in the encryption context // of certain subsequent operations that the grant allows. Constraints *GrantConstraints `type:"structure"` // The date and time when the grant was created. CreationDate *time.Time `type:"timestamp"` // The unique identifier for the grant. GrantId *string `min:"1" type:"string"` // The identity that gets the permissions in the grant. // // The GranteePrincipal field in the ListGrants response usually contains the // user or role designated as the grantee principal in the grant. However, when // the grantee principal in the grant is an Amazon Web Services service, the // GranteePrincipal field contains the service principal (path_to_url#principal-services), // which might represent several different grantee principals. GranteePrincipal *string `min:"1" type:"string"` // The Amazon Web Services account under which the grant was issued. IssuingAccount *string `min:"1" type:"string"` // The unique identifier for the KMS key to which the grant applies. KeyId *string `min:"1" type:"string"` // The friendly name that identifies the grant. If a name was provided in the // CreateGrant request, that name is returned. Otherwise this value is null. Name *string `min:"1" type:"string"` // The list of operations permitted by the grant. Operations []*string `type:"list" enum:"GrantOperation"` // The principal that can retire the grant. RetiringPrincipal *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GrantListEntry) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GrantListEntry) GoString() string { return s.String() } // SetConstraints sets the Constraints field's value. func (s *GrantListEntry) SetConstraints(v *GrantConstraints) *GrantListEntry { s.Constraints = v return s } // SetCreationDate sets the CreationDate field's value. func (s *GrantListEntry) SetCreationDate(v time.Time) *GrantListEntry { s.CreationDate = &v return s } // SetGrantId sets the GrantId field's value. func (s *GrantListEntry) SetGrantId(v string) *GrantListEntry { s.GrantId = &v return s } // SetGranteePrincipal sets the GranteePrincipal field's value. func (s *GrantListEntry) SetGranteePrincipal(v string) *GrantListEntry { s.GranteePrincipal = &v return s } // SetIssuingAccount sets the IssuingAccount field's value. func (s *GrantListEntry) SetIssuingAccount(v string) *GrantListEntry { s.IssuingAccount = &v return s } // SetKeyId sets the KeyId field's value. func (s *GrantListEntry) SetKeyId(v string) *GrantListEntry { s.KeyId = &v return s } // SetName sets the Name field's value. func (s *GrantListEntry) SetName(v string) *GrantListEntry { s.Name = &v return s } // SetOperations sets the Operations field's value. func (s *GrantListEntry) SetOperations(v []*string) *GrantListEntry { s.Operations = v return s } // SetRetiringPrincipal sets the RetiringPrincipal field's value. func (s *GrantListEntry) SetRetiringPrincipal(v string) *GrantListEntry { s.RetiringPrincipal = &v return s } type ImportKeyMaterialInput struct { _ struct{} `type:"structure"` // The encrypted key material to import. The key material must be encrypted // under the public wrapping key that GetParametersForImport returned, using // the wrapping algorithm that you specified in the same GetParametersForImport // request. // EncryptedKeyMaterial is automatically base64 encoded/decoded by the SDK. // // EncryptedKeyMaterial is a required field EncryptedKeyMaterial []byte `min:"1" type:"blob" required:"true"` // Specifies whether the key material expires. The default is KEY_MATERIAL_EXPIRES. // For help with this choice, see Setting an expiration time (path_to_url#importing-keys-expiration) // in the Key Management Service Developer Guide. // // When the value of ExpirationModel is KEY_MATERIAL_EXPIRES, you must specify // a value for the ValidTo parameter. When value is KEY_MATERIAL_DOES_NOT_EXPIRE, // you must omit the ValidTo parameter. // // You cannot change the ExpirationModel or ValidTo values for the current import // after the request completes. To change either value, you must reimport the // key material. ExpirationModel *string `type:"string" enum:"ExpirationModelType"` // The import token that you received in the response to a previous GetParametersForImport // request. It must be from the same response that contained the public key // that you used to encrypt the key material. // ImportToken is automatically base64 encoded/decoded by the SDK. // // ImportToken is a required field ImportToken []byte `min:"1" type:"blob" required:"true"` // The identifier of the KMS key that will be associated with the imported key // material. This must be the same KMS key specified in the KeyID parameter // of the corresponding GetParametersForImport request. The Origin of the KMS // key must be EXTERNAL and its KeyState must be PendingImport. // // The KMS key can be a symmetric encryption KMS key, HMAC KMS key, asymmetric // encryption KMS key, or asymmetric signing KMS key, including a multi-Region // key (kms/latest/developerguide/multi-region-keys-overview.html) of any supported // type. You cannot perform this operation on a KMS key in a custom key store, // or on a KMS key in a different Amazon Web Services account. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // The date and time when the imported key material expires. This parameter // is required when the value of the ExpirationModel parameter is KEY_MATERIAL_EXPIRES. // Otherwise it is not valid. // // The value of this parameter must be a future date and time. The maximum value // is 365 days from the request date. // // When the key material expires, KMS deletes the key material from the KMS // key. Without its key material, the KMS key is unusable. To use the KMS key // in cryptographic operations, you must reimport the same key material. // // You cannot change the ExpirationModel or ValidTo values for the current import // after the request completes. To change either value, you must delete (DeleteImportedKeyMaterial) // and reimport the key material. ValidTo *time.Time `type:"timestamp"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ImportKeyMaterialInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ImportKeyMaterialInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *ImportKeyMaterialInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ImportKeyMaterialInput"} if s.EncryptedKeyMaterial == nil { invalidParams.Add(request.NewErrParamRequired("EncryptedKeyMaterial")) } if s.EncryptedKeyMaterial != nil && len(s.EncryptedKeyMaterial) < 1 { invalidParams.Add(request.NewErrParamMinLen("EncryptedKeyMaterial", 1)) } if s.ImportToken == nil { invalidParams.Add(request.NewErrParamRequired("ImportToken")) } if s.ImportToken != nil && len(s.ImportToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("ImportToken", 1)) } if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetEncryptedKeyMaterial sets the EncryptedKeyMaterial field's value. func (s *ImportKeyMaterialInput) SetEncryptedKeyMaterial(v []byte) *ImportKeyMaterialInput { s.EncryptedKeyMaterial = v return s } // SetExpirationModel sets the ExpirationModel field's value. func (s *ImportKeyMaterialInput) SetExpirationModel(v string) *ImportKeyMaterialInput { s.ExpirationModel = &v return s } // SetImportToken sets the ImportToken field's value. func (s *ImportKeyMaterialInput) SetImportToken(v []byte) *ImportKeyMaterialInput { s.ImportToken = v return s } // SetKeyId sets the KeyId field's value. func (s *ImportKeyMaterialInput) SetKeyId(v string) *ImportKeyMaterialInput { s.KeyId = &v return s } // SetValidTo sets the ValidTo field's value. func (s *ImportKeyMaterialInput) SetValidTo(v time.Time) *ImportKeyMaterialInput { s.ValidTo = &v return s } type ImportKeyMaterialOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ImportKeyMaterialOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ImportKeyMaterialOutput) GoString() string { return s.String() } // The request was rejected because the specified KMS key cannot decrypt the // data. The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request // must identify the same KMS key that was used to encrypt the ciphertext. type IncorrectKeyException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s IncorrectKeyException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s IncorrectKeyException) GoString() string { return s.String() } func newErrorIncorrectKeyException(v protocol.ResponseMetadata) error { return &IncorrectKeyException{ RespMetadata: v, } } // Code returns the exception type name. func (s *IncorrectKeyException) Code() string { return "IncorrectKeyException" } // Message returns the exception's message. func (s *IncorrectKeyException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *IncorrectKeyException) OrigErr() error { return nil } func (s *IncorrectKeyException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *IncorrectKeyException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *IncorrectKeyException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the key material in the request is, expired, // invalid, or is not the same key material that was previously imported into // this KMS key. type IncorrectKeyMaterialException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s IncorrectKeyMaterialException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s IncorrectKeyMaterialException) GoString() string { return s.String() } func newErrorIncorrectKeyMaterialException(v protocol.ResponseMetadata) error { return &IncorrectKeyMaterialException{ RespMetadata: v, } } // Code returns the exception type name. func (s *IncorrectKeyMaterialException) Code() string { return "IncorrectKeyMaterialException" } // Message returns the exception's message. func (s *IncorrectKeyMaterialException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *IncorrectKeyMaterialException) OrigErr() error { return nil } func (s *IncorrectKeyMaterialException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *IncorrectKeyMaterialException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *IncorrectKeyMaterialException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the trust anchor certificate in the request // to create an CloudHSM key store is not the trust anchor certificate for the // specified CloudHSM cluster. // // When you initialize the CloudHSM cluster (path_to_url#sign-csr), // you create the trust anchor certificate and save it in the customerCA.crt // file. type IncorrectTrustAnchorException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s IncorrectTrustAnchorException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s IncorrectTrustAnchorException) GoString() string { return s.String() } func newErrorIncorrectTrustAnchorException(v protocol.ResponseMetadata) error { return &IncorrectTrustAnchorException{ RespMetadata: v, } } // Code returns the exception type name. func (s *IncorrectTrustAnchorException) Code() string { return "IncorrectTrustAnchorException" } // Message returns the exception's message. func (s *IncorrectTrustAnchorException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *IncorrectTrustAnchorException) OrigErr() error { return nil } func (s *IncorrectTrustAnchorException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *IncorrectTrustAnchorException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *IncorrectTrustAnchorException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because an internal exception occurred. The request // can be retried. type InternalException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InternalException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InternalException) GoString() string { return s.String() } func newErrorInternalException(v protocol.ResponseMetadata) error { return &InternalException{ RespMetadata: v, } } // Code returns the exception type name. func (s *InternalException) Code() string { return "KMSInternalException" } // Message returns the exception's message. func (s *InternalException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *InternalException) OrigErr() error { return nil } func (s *InternalException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *InternalException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *InternalException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the specified alias name is not valid. type InvalidAliasNameException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidAliasNameException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidAliasNameException) GoString() string { return s.String() } func newErrorInvalidAliasNameException(v protocol.ResponseMetadata) error { return &InvalidAliasNameException{ RespMetadata: v, } } // Code returns the exception type name. func (s *InvalidAliasNameException) Code() string { return "InvalidAliasNameException" } // Message returns the exception's message. func (s *InvalidAliasNameException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *InvalidAliasNameException) OrigErr() error { return nil } func (s *InvalidAliasNameException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *InvalidAliasNameException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *InvalidAliasNameException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. type InvalidArnException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidArnException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidArnException) GoString() string { return s.String() } func newErrorInvalidArnException(v protocol.ResponseMetadata) error { return &InvalidArnException{ RespMetadata: v, } } // Code returns the exception type name. func (s *InvalidArnException) Code() string { return "InvalidArnException" } // Message returns the exception's message. func (s *InvalidArnException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *InvalidArnException) OrigErr() error { return nil } func (s *InvalidArnException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *InvalidArnException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *InvalidArnException) RequestID() string { return s.RespMetadata.RequestID } // From the Decrypt or ReEncrypt operation, the request was rejected because // the specified ciphertext, or additional authenticated data incorporated into // the ciphertext, such as the encryption context, is corrupted, missing, or // otherwise invalid. // // From the ImportKeyMaterial operation, the request was rejected because KMS // could not decrypt the encrypted (wrapped) key material. type InvalidCiphertextException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidCiphertextException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidCiphertextException) GoString() string { return s.String() } func newErrorInvalidCiphertextException(v protocol.ResponseMetadata) error { return &InvalidCiphertextException{ RespMetadata: v, } } // Code returns the exception type name. func (s *InvalidCiphertextException) Code() string { return "InvalidCiphertextException" } // Message returns the exception's message. func (s *InvalidCiphertextException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *InvalidCiphertextException) OrigErr() error { return nil } func (s *InvalidCiphertextException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *InvalidCiphertextException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *InvalidCiphertextException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the specified GrantId is not valid. type InvalidGrantIdException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidGrantIdException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidGrantIdException) GoString() string { return s.String() } func newErrorInvalidGrantIdException(v protocol.ResponseMetadata) error { return &InvalidGrantIdException{ RespMetadata: v, } } // Code returns the exception type name. func (s *InvalidGrantIdException) Code() string { return "InvalidGrantIdException" } // Message returns the exception's message. func (s *InvalidGrantIdException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *InvalidGrantIdException) OrigErr() error { return nil } func (s *InvalidGrantIdException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *InvalidGrantIdException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *InvalidGrantIdException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the specified grant token is not valid. type InvalidGrantTokenException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidGrantTokenException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidGrantTokenException) GoString() string { return s.String() } func newErrorInvalidGrantTokenException(v protocol.ResponseMetadata) error { return &InvalidGrantTokenException{ RespMetadata: v, } } // Code returns the exception type name. func (s *InvalidGrantTokenException) Code() string { return "InvalidGrantTokenException" } // Message returns the exception's message. func (s *InvalidGrantTokenException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *InvalidGrantTokenException) OrigErr() error { return nil } func (s *InvalidGrantTokenException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *InvalidGrantTokenException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *InvalidGrantTokenException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the provided import token is invalid or // is associated with a different KMS key. type InvalidImportTokenException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidImportTokenException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidImportTokenException) GoString() string { return s.String() } func newErrorInvalidImportTokenException(v protocol.ResponseMetadata) error { return &InvalidImportTokenException{ RespMetadata: v, } } // Code returns the exception type name. func (s *InvalidImportTokenException) Code() string { return "InvalidImportTokenException" } // Message returns the exception's message. func (s *InvalidImportTokenException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *InvalidImportTokenException) OrigErr() error { return nil } func (s *InvalidImportTokenException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *InvalidImportTokenException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *InvalidImportTokenException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected for one of the following reasons: // // - The KeyUsage value of the KMS key is incompatible with the API operation. // // - The encryption algorithm or signing algorithm specified for the operation // is incompatible with the type of key material in the KMS key (KeySpec). // // For encrypting, decrypting, re-encrypting, and generating data keys, the // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying messages, the // KeyUsage must be SIGN_VERIFY. For generating and verifying message authentication // codes (MACs), the KeyUsage must be GENERATE_VERIFY_MAC. To find the KeyUsage // of a KMS key, use the DescribeKey operation. // // To find the encryption or signing algorithms supported for a particular KMS // key, use the DescribeKey operation. type InvalidKeyUsageException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidKeyUsageException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidKeyUsageException) GoString() string { return s.String() } func newErrorInvalidKeyUsageException(v protocol.ResponseMetadata) error { return &InvalidKeyUsageException{ RespMetadata: v, } } // Code returns the exception type name. func (s *InvalidKeyUsageException) Code() string { return "InvalidKeyUsageException" } // Message returns the exception's message. func (s *InvalidKeyUsageException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *InvalidKeyUsageException) OrigErr() error { return nil } func (s *InvalidKeyUsageException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *InvalidKeyUsageException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *InvalidKeyUsageException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the marker that specifies where pagination // should next begin is not valid. type InvalidMarkerException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidMarkerException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidMarkerException) GoString() string { return s.String() } func newErrorInvalidMarkerException(v protocol.ResponseMetadata) error { return &InvalidMarkerException{ RespMetadata: v, } } // Code returns the exception type name. func (s *InvalidMarkerException) Code() string { return "InvalidMarkerException" } // Message returns the exception's message. func (s *InvalidMarkerException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *InvalidMarkerException) OrigErr() error { return nil } func (s *InvalidMarkerException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *InvalidMarkerException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *InvalidMarkerException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the state of the specified resource is not // valid for this request. // // This exceptions means one of the following: // // - The key state of the KMS key is not compatible with the operation. To // find the key state, use the DescribeKey operation. For more information // about which key states are compatible with each KMS operation, see Key // states of KMS keys (path_to_url // in the Key Management Service Developer Guide . // // - For cryptographic operations on KMS keys in custom key stores, this // exception represents a general failure with many possible causes. To identify // the cause, see the error message that accompanies the exception. type InvalidStateException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidStateException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InvalidStateException) GoString() string { return s.String() } func newErrorInvalidStateException(v protocol.ResponseMetadata) error { return &InvalidStateException{ RespMetadata: v, } } // Code returns the exception type name. func (s *InvalidStateException) Code() string { return "KMSInvalidStateException" } // Message returns the exception's message. func (s *InvalidStateException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *InvalidStateException) OrigErr() error { return nil } func (s *InvalidStateException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *InvalidStateException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *InvalidStateException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the HMAC verification failed. HMAC verification // fails when the HMAC computed by using the specified message, HMAC KMS key, // and MAC algorithm does not match the HMAC specified in the request. type KMSInvalidMacException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s KMSInvalidMacException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s KMSInvalidMacException) GoString() string { return s.String() } func newErrorKMSInvalidMacException(v protocol.ResponseMetadata) error { return &KMSInvalidMacException{ RespMetadata: v, } } // Code returns the exception type name. func (s *KMSInvalidMacException) Code() string { return "KMSInvalidMacException" } // Message returns the exception's message. func (s *KMSInvalidMacException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *KMSInvalidMacException) OrigErr() error { return nil } func (s *KMSInvalidMacException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *KMSInvalidMacException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *KMSInvalidMacException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the signature verification failed. Signature // verification fails when it cannot confirm that signature was produced by // signing the specified message with the specified KMS key and signing algorithm. type KMSInvalidSignatureException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s KMSInvalidSignatureException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s KMSInvalidSignatureException) GoString() string { return s.String() } func newErrorKMSInvalidSignatureException(v protocol.ResponseMetadata) error { return &KMSInvalidSignatureException{ RespMetadata: v, } } // Code returns the exception type name. func (s *KMSInvalidSignatureException) Code() string { return "KMSInvalidSignatureException" } // Message returns the exception's message. func (s *KMSInvalidSignatureException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *KMSInvalidSignatureException) OrigErr() error { return nil } func (s *KMSInvalidSignatureException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *KMSInvalidSignatureException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *KMSInvalidSignatureException) RequestID() string { return s.RespMetadata.RequestID } // Contains information about each entry in the key list. type KeyListEntry struct { _ struct{} `type:"structure"` // ARN of the key. KeyArn *string `min:"20" type:"string"` // Unique identifier of the key. KeyId *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s KeyListEntry) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s KeyListEntry) GoString() string { return s.String() } // SetKeyArn sets the KeyArn field's value. func (s *KeyListEntry) SetKeyArn(v string) *KeyListEntry { s.KeyArn = &v return s } // SetKeyId sets the KeyId field's value. func (s *KeyListEntry) SetKeyId(v string) *KeyListEntry { s.KeyId = &v return s } // Contains metadata about a KMS key. // // This data type is used as a response element for the CreateKey, DescribeKey, // and ReplicateKey operations. type KeyMetadata struct { _ struct{} `type:"structure"` // The twelve-digit account ID of the Amazon Web Services account that owns // the KMS key. AWSAccountId *string `type:"string"` // The Amazon Resource Name (ARN) of the KMS key. For examples, see Key Management // Service (KMS) (path_to_url#arn-syntax-kms) // in the Example ARNs section of the Amazon Web Services General Reference. Arn *string `min:"20" type:"string"` // The cluster ID of the CloudHSM cluster that contains the key material for // the KMS key. When you create a KMS key in an CloudHSM custom key store (path_to_url // KMS creates the key material for the KMS key in the associated CloudHSM cluster. // This field is present only when the KMS key is created in an CloudHSM key // store. CloudHsmClusterId *string `min:"19" type:"string"` // The date and time when the KMS key was created. CreationDate *time.Time `type:"timestamp"` // A unique identifier for the custom key store (path_to_url // that contains the KMS key. This field is present only when the KMS key is // created in a custom key store. CustomKeyStoreId *string `min:"1" type:"string"` // Instead, use the KeySpec field. // // The KeySpec and CustomerMasterKeySpec fields have the same value. We recommend // that you use the KeySpec field in your code. However, to avoid breaking changes, // KMS supports both fields. // // Deprecated: This field has been deprecated. Instead, use the KeySpec field. CustomerMasterKeySpec *string `deprecated:"true" type:"string" enum:"CustomerMasterKeySpec"` // The date and time after which KMS deletes this KMS key. This value is present // only when the KMS key is scheduled for deletion, that is, when its KeyState // is PendingDeletion. // // When the primary key in a multi-Region key is scheduled for deletion but // still has replica keys, its key state is PendingReplicaDeletion and the length // of its waiting period is displayed in the PendingDeletionWindowInDays field. DeletionDate *time.Time `type:"timestamp"` // The description of the KMS key. Description *string `type:"string"` // Specifies whether the KMS key is enabled. When KeyState is Enabled this value // is true, otherwise it is false. Enabled *bool `type:"boolean"` // The encryption algorithms that the KMS key supports. You cannot use the KMS // key with other encryption algorithms within KMS. // // This value is present only when the KeyUsage of the KMS key is ENCRYPT_DECRYPT. EncryptionAlgorithms []*string `type:"list" enum:"EncryptionAlgorithmSpec"` // Specifies whether the KMS key's key material expires. This value is present // only when Origin is EXTERNAL, otherwise this value is omitted. ExpirationModel *string `type:"string" enum:"ExpirationModelType"` // The globally unique identifier for the KMS key. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // The manager of the KMS key. KMS keys in your Amazon Web Services account // are either customer managed or Amazon Web Services managed. For more information // about the difference, see KMS keys (path_to_url#kms_keys) // in the Key Management Service Developer Guide. KeyManager *string `type:"string" enum:"KeyManagerType"` // Describes the type of key material in the KMS key. KeySpec *string `type:"string" enum:"KeySpec"` // The current status of the KMS key. // // For more information about how key state affects the use of a KMS key, see // Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. KeyState *string `type:"string" enum:"KeyState"` // The cryptographic operations (path_to_url#cryptographic-operations) // for which you can use the KMS key. KeyUsage *string `type:"string" enum:"KeyUsageType"` // The message authentication code (MAC) algorithm that the HMAC KMS key supports. // // This value is present only when the KeyUsage of the KMS key is GENERATE_VERIFY_MAC. MacAlgorithms []*string `type:"list" enum:"MacAlgorithmSpec"` // Indicates whether the KMS key is a multi-Region (True) or regional (False) // key. This value is True for multi-Region primary and replica keys and False // for regional KMS keys. // // For more information about multi-Region keys, see Multi-Region keys in KMS // (path_to_url // in the Key Management Service Developer Guide. MultiRegion *bool `type:"boolean"` // Lists the primary and replica keys in same multi-Region key. This field is // present only when the value of the MultiRegion field is True. // // For more information about any listed KMS key, use the DescribeKey operation. // // * MultiRegionKeyType indicates whether the KMS key is a PRIMARY or REPLICA // key. // // * PrimaryKey displays the key ARN and Region of the primary key. This // field displays the current KMS key if it is the primary key. // // * ReplicaKeys displays the key ARNs and Regions of all replica keys. This // field includes the current KMS key if it is a replica key. MultiRegionConfiguration *MultiRegionConfiguration `type:"structure"` // The source of the key material for the KMS key. When this value is AWS_KMS, // KMS created the key material. When this value is EXTERNAL, the key material // was imported or the KMS key doesn't have any key material. When this value // is AWS_CLOUDHSM, the key material was created in the CloudHSM cluster associated // with a custom key store. Origin *string `type:"string" enum:"OriginType"` // The waiting period before the primary key in a multi-Region key is deleted. // This waiting period begins when the last of its replica keys is deleted. // This value is present only when the KeyState of the KMS key is PendingReplicaDeletion. // That indicates that the KMS key is the primary key in a multi-Region key, // it is scheduled for deletion, and it still has existing replica keys. // // When a single-Region KMS key or a multi-Region replica key is scheduled for // deletion, its deletion date is displayed in the DeletionDate field. However, // when the primary key in a multi-Region key is scheduled for deletion, its // waiting period doesn't begin until all of its replica keys are deleted. This // value displays that waiting period. When the last replica key in the multi-Region // key is deleted, the KeyState of the scheduled primary key changes from PendingReplicaDeletion // to PendingDeletion and the deletion date appears in the DeletionDate field. PendingDeletionWindowInDays *int64 `min:"1" type:"integer"` // The signing algorithms that the KMS key supports. You cannot use the KMS // key with other signing algorithms within KMS. // // This field appears only when the KeyUsage of the KMS key is SIGN_VERIFY. SigningAlgorithms []*string `type:"list" enum:"SigningAlgorithmSpec"` // The time at which the imported key material expires. When the key material // expires, KMS deletes the key material and the KMS key becomes unusable. This // value is present only for KMS keys whose Origin is EXTERNAL and whose ExpirationModel // is KEY_MATERIAL_EXPIRES, otherwise this value is omitted. ValidTo *time.Time `type:"timestamp"` // Information about the external key that is associated with a KMS key in an // external key store. // // For more information, see External key (path_to_url#concept-external-key) // in the Key Management Service Developer Guide. XksKeyConfiguration *XksKeyConfigurationType `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s KeyMetadata) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s KeyMetadata) GoString() string { return s.String() } // SetAWSAccountId sets the AWSAccountId field's value. func (s *KeyMetadata) SetAWSAccountId(v string) *KeyMetadata { s.AWSAccountId = &v return s } // SetArn sets the Arn field's value. func (s *KeyMetadata) SetArn(v string) *KeyMetadata { s.Arn = &v return s } // SetCloudHsmClusterId sets the CloudHsmClusterId field's value. func (s *KeyMetadata) SetCloudHsmClusterId(v string) *KeyMetadata { s.CloudHsmClusterId = &v return s } // SetCreationDate sets the CreationDate field's value. func (s *KeyMetadata) SetCreationDate(v time.Time) *KeyMetadata { s.CreationDate = &v return s } // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. func (s *KeyMetadata) SetCustomKeyStoreId(v string) *KeyMetadata { s.CustomKeyStoreId = &v return s } // SetCustomerMasterKeySpec sets the CustomerMasterKeySpec field's value. func (s *KeyMetadata) SetCustomerMasterKeySpec(v string) *KeyMetadata { s.CustomerMasterKeySpec = &v return s } // SetDeletionDate sets the DeletionDate field's value. func (s *KeyMetadata) SetDeletionDate(v time.Time) *KeyMetadata { s.DeletionDate = &v return s } // SetDescription sets the Description field's value. func (s *KeyMetadata) SetDescription(v string) *KeyMetadata { s.Description = &v return s } // SetEnabled sets the Enabled field's value. func (s *KeyMetadata) SetEnabled(v bool) *KeyMetadata { s.Enabled = &v return s } // SetEncryptionAlgorithms sets the EncryptionAlgorithms field's value. func (s *KeyMetadata) SetEncryptionAlgorithms(v []*string) *KeyMetadata { s.EncryptionAlgorithms = v return s } // SetExpirationModel sets the ExpirationModel field's value. func (s *KeyMetadata) SetExpirationModel(v string) *KeyMetadata { s.ExpirationModel = &v return s } // SetKeyId sets the KeyId field's value. func (s *KeyMetadata) SetKeyId(v string) *KeyMetadata { s.KeyId = &v return s } // SetKeyManager sets the KeyManager field's value. func (s *KeyMetadata) SetKeyManager(v string) *KeyMetadata { s.KeyManager = &v return s } // SetKeySpec sets the KeySpec field's value. func (s *KeyMetadata) SetKeySpec(v string) *KeyMetadata { s.KeySpec = &v return s } // SetKeyState sets the KeyState field's value. func (s *KeyMetadata) SetKeyState(v string) *KeyMetadata { s.KeyState = &v return s } // SetKeyUsage sets the KeyUsage field's value. func (s *KeyMetadata) SetKeyUsage(v string) *KeyMetadata { s.KeyUsage = &v return s } // SetMacAlgorithms sets the MacAlgorithms field's value. func (s *KeyMetadata) SetMacAlgorithms(v []*string) *KeyMetadata { s.MacAlgorithms = v return s } // SetMultiRegion sets the MultiRegion field's value. func (s *KeyMetadata) SetMultiRegion(v bool) *KeyMetadata { s.MultiRegion = &v return s } // SetMultiRegionConfiguration sets the MultiRegionConfiguration field's value. func (s *KeyMetadata) SetMultiRegionConfiguration(v *MultiRegionConfiguration) *KeyMetadata { s.MultiRegionConfiguration = v return s } // SetOrigin sets the Origin field's value. func (s *KeyMetadata) SetOrigin(v string) *KeyMetadata { s.Origin = &v return s } // SetPendingDeletionWindowInDays sets the PendingDeletionWindowInDays field's value. func (s *KeyMetadata) SetPendingDeletionWindowInDays(v int64) *KeyMetadata { s.PendingDeletionWindowInDays = &v return s } // SetSigningAlgorithms sets the SigningAlgorithms field's value. func (s *KeyMetadata) SetSigningAlgorithms(v []*string) *KeyMetadata { s.SigningAlgorithms = v return s } // SetValidTo sets the ValidTo field's value. func (s *KeyMetadata) SetValidTo(v time.Time) *KeyMetadata { s.ValidTo = &v return s } // SetXksKeyConfiguration sets the XksKeyConfiguration field's value. func (s *KeyMetadata) SetXksKeyConfiguration(v *XksKeyConfigurationType) *KeyMetadata { s.XksKeyConfiguration = v return s } // The request was rejected because the specified KMS key was not available. // You can retry the request. type KeyUnavailableException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s KeyUnavailableException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s KeyUnavailableException) GoString() string { return s.String() } func newErrorKeyUnavailableException(v protocol.ResponseMetadata) error { return &KeyUnavailableException{ RespMetadata: v, } } // Code returns the exception type name. func (s *KeyUnavailableException) Code() string { return "KeyUnavailableException" } // Message returns the exception's message. func (s *KeyUnavailableException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *KeyUnavailableException) OrigErr() error { return nil } func (s *KeyUnavailableException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *KeyUnavailableException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *KeyUnavailableException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because a quota was exceeded. For more information, // see Quotas (path_to_url // in the Key Management Service Developer Guide. type LimitExceededException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s LimitExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s LimitExceededException) GoString() string { return s.String() } func newErrorLimitExceededException(v protocol.ResponseMetadata) error { return &LimitExceededException{ RespMetadata: v, } } // Code returns the exception type name. func (s *LimitExceededException) Code() string { return "LimitExceededException" } // Message returns the exception's message. func (s *LimitExceededException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *LimitExceededException) OrigErr() error { return nil } func (s *LimitExceededException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *LimitExceededException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *LimitExceededException) RequestID() string { return s.RespMetadata.RequestID } type ListAliasesInput struct { _ struct{} `type:"structure"` // Lists only aliases that are associated with the specified KMS key. Enter // a KMS key in your Amazon Web Services account. // // This parameter is optional. If you omit it, ListAliases returns all aliases // in the account and Region. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. KeyId *string `min:"1" type:"string"` // Use this parameter to specify the maximum number of items to return. When // this value is present, KMS does not return more than the specified number // of items, but it might return fewer. // // This value is optional. If you include a value, it must be between 1 and // 100, inclusive. If you do not include a value, it defaults to 50. Limit *int64 `min:"1" type:"integer"` // Use this parameter in a subsequent request after you receive a response with // truncated results. Set it to the value of NextMarker from the truncated response // you just received. Marker *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListAliasesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListAliasesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *ListAliasesInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ListAliasesInput"} if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.Limit != nil && *s.Limit < 1 { invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) } if s.Marker != nil && len(*s.Marker) < 1 { invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *ListAliasesInput) SetKeyId(v string) *ListAliasesInput { s.KeyId = &v return s } // SetLimit sets the Limit field's value. func (s *ListAliasesInput) SetLimit(v int64) *ListAliasesInput { s.Limit = &v return s } // SetMarker sets the Marker field's value. func (s *ListAliasesInput) SetMarker(v string) *ListAliasesInput { s.Marker = &v return s } type ListAliasesOutput struct { _ struct{} `type:"structure"` // A list of aliases. Aliases []*AliasListEntry `type:"list"` // When Truncated is true, this element is present and contains the value to // use for the Marker parameter in a subsequent request. NextMarker *string `min:"1" type:"string"` // A flag that indicates whether there are more items in the list. When this // value is true, the list in this response is truncated. To get more items, // pass the value of the NextMarker element in thisresponse to the Marker parameter // in a subsequent request. Truncated *bool `type:"boolean"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListAliasesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListAliasesOutput) GoString() string { return s.String() } // SetAliases sets the Aliases field's value. func (s *ListAliasesOutput) SetAliases(v []*AliasListEntry) *ListAliasesOutput { s.Aliases = v return s } // SetNextMarker sets the NextMarker field's value. func (s *ListAliasesOutput) SetNextMarker(v string) *ListAliasesOutput { s.NextMarker = &v return s } // SetTruncated sets the Truncated field's value. func (s *ListAliasesOutput) SetTruncated(v bool) *ListAliasesOutput { s.Truncated = &v return s } type ListGrantsInput struct { _ struct{} `type:"structure"` // Returns only the grant with the specified grant ID. The grant ID uniquely // identifies the grant. GrantId *string `min:"1" type:"string"` // Returns only grants where the specified principal is the grantee principal // for the grant. GranteePrincipal *string `min:"1" type:"string"` // Returns only grants for the specified KMS key. This parameter is required. // // Specify the key ID or key ARN of the KMS key. To specify a KMS key in a different // Amazon Web Services account, you must use the key ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // Use this parameter to specify the maximum number of items to return. When // this value is present, KMS does not return more than the specified number // of items, but it might return fewer. // // This value is optional. If you include a value, it must be between 1 and // 100, inclusive. If you do not include a value, it defaults to 50. Limit *int64 `min:"1" type:"integer"` // Use this parameter in a subsequent request after you receive a response with // truncated results. Set it to the value of NextMarker from the truncated response // you just received. Marker *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListGrantsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListGrantsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *ListGrantsInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ListGrantsInput"} if s.GrantId != nil && len(*s.GrantId) < 1 { invalidParams.Add(request.NewErrParamMinLen("GrantId", 1)) } if s.GranteePrincipal != nil && len(*s.GranteePrincipal) < 1 { invalidParams.Add(request.NewErrParamMinLen("GranteePrincipal", 1)) } if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.Limit != nil && *s.Limit < 1 { invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) } if s.Marker != nil && len(*s.Marker) < 1 { invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetGrantId sets the GrantId field's value. func (s *ListGrantsInput) SetGrantId(v string) *ListGrantsInput { s.GrantId = &v return s } // SetGranteePrincipal sets the GranteePrincipal field's value. func (s *ListGrantsInput) SetGranteePrincipal(v string) *ListGrantsInput { s.GranteePrincipal = &v return s } // SetKeyId sets the KeyId field's value. func (s *ListGrantsInput) SetKeyId(v string) *ListGrantsInput { s.KeyId = &v return s } // SetLimit sets the Limit field's value. func (s *ListGrantsInput) SetLimit(v int64) *ListGrantsInput { s.Limit = &v return s } // SetMarker sets the Marker field's value. func (s *ListGrantsInput) SetMarker(v string) *ListGrantsInput { s.Marker = &v return s } type ListGrantsResponse struct { _ struct{} `type:"structure"` // A list of grants. Grants []*GrantListEntry `type:"list"` // When Truncated is true, this element is present and contains the value to // use for the Marker parameter in a subsequent request. NextMarker *string `min:"1" type:"string"` // A flag that indicates whether there are more items in the list. When this // value is true, the list in this response is truncated. To get more items, // pass the value of the NextMarker element in thisresponse to the Marker parameter // in a subsequent request. Truncated *bool `type:"boolean"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListGrantsResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListGrantsResponse) GoString() string { return s.String() } // SetGrants sets the Grants field's value. func (s *ListGrantsResponse) SetGrants(v []*GrantListEntry) *ListGrantsResponse { s.Grants = v return s } // SetNextMarker sets the NextMarker field's value. func (s *ListGrantsResponse) SetNextMarker(v string) *ListGrantsResponse { s.NextMarker = &v return s } // SetTruncated sets the Truncated field's value. func (s *ListGrantsResponse) SetTruncated(v bool) *ListGrantsResponse { s.Truncated = &v return s } type ListKeyPoliciesInput struct { _ struct{} `type:"structure"` // Gets the names of key policies for the specified KMS key. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // Use this parameter to specify the maximum number of items to return. When // this value is present, KMS does not return more than the specified number // of items, but it might return fewer. // // This value is optional. If you include a value, it must be between 1 and // 1000, inclusive. If you do not include a value, it defaults to 100. // // Only one policy can be attached to a key. Limit *int64 `min:"1" type:"integer"` // Use this parameter in a subsequent request after you receive a response with // truncated results. Set it to the value of NextMarker from the truncated response // you just received. Marker *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListKeyPoliciesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListKeyPoliciesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *ListKeyPoliciesInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ListKeyPoliciesInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.Limit != nil && *s.Limit < 1 { invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) } if s.Marker != nil && len(*s.Marker) < 1 { invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *ListKeyPoliciesInput) SetKeyId(v string) *ListKeyPoliciesInput { s.KeyId = &v return s } // SetLimit sets the Limit field's value. func (s *ListKeyPoliciesInput) SetLimit(v int64) *ListKeyPoliciesInput { s.Limit = &v return s } // SetMarker sets the Marker field's value. func (s *ListKeyPoliciesInput) SetMarker(v string) *ListKeyPoliciesInput { s.Marker = &v return s } type ListKeyPoliciesOutput struct { _ struct{} `type:"structure"` // When Truncated is true, this element is present and contains the value to // use for the Marker parameter in a subsequent request. NextMarker *string `min:"1" type:"string"` // A list of key policy names. The only valid value is default. PolicyNames []*string `type:"list"` // A flag that indicates whether there are more items in the list. When this // value is true, the list in this response is truncated. To get more items, // pass the value of the NextMarker element in thisresponse to the Marker parameter // in a subsequent request. Truncated *bool `type:"boolean"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListKeyPoliciesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListKeyPoliciesOutput) GoString() string { return s.String() } // SetNextMarker sets the NextMarker field's value. func (s *ListKeyPoliciesOutput) SetNextMarker(v string) *ListKeyPoliciesOutput { s.NextMarker = &v return s } // SetPolicyNames sets the PolicyNames field's value. func (s *ListKeyPoliciesOutput) SetPolicyNames(v []*string) *ListKeyPoliciesOutput { s.PolicyNames = v return s } // SetTruncated sets the Truncated field's value. func (s *ListKeyPoliciesOutput) SetTruncated(v bool) *ListKeyPoliciesOutput { s.Truncated = &v return s } type ListKeysInput struct { _ struct{} `type:"structure"` // Use this parameter to specify the maximum number of items to return. When // this value is present, KMS does not return more than the specified number // of items, but it might return fewer. // // This value is optional. If you include a value, it must be between 1 and // 1000, inclusive. If you do not include a value, it defaults to 100. Limit *int64 `min:"1" type:"integer"` // Use this parameter in a subsequent request after you receive a response with // truncated results. Set it to the value of NextMarker from the truncated response // you just received. Marker *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListKeysInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListKeysInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *ListKeysInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ListKeysInput"} if s.Limit != nil && *s.Limit < 1 { invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) } if s.Marker != nil && len(*s.Marker) < 1 { invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetLimit sets the Limit field's value. func (s *ListKeysInput) SetLimit(v int64) *ListKeysInput { s.Limit = &v return s } // SetMarker sets the Marker field's value. func (s *ListKeysInput) SetMarker(v string) *ListKeysInput { s.Marker = &v return s } type ListKeysOutput struct { _ struct{} `type:"structure"` // A list of KMS keys. Keys []*KeyListEntry `type:"list"` // When Truncated is true, this element is present and contains the value to // use for the Marker parameter in a subsequent request. NextMarker *string `min:"1" type:"string"` // A flag that indicates whether there are more items in the list. When this // value is true, the list in this response is truncated. To get more items, // pass the value of the NextMarker element in thisresponse to the Marker parameter // in a subsequent request. Truncated *bool `type:"boolean"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListKeysOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListKeysOutput) GoString() string { return s.String() } // SetKeys sets the Keys field's value. func (s *ListKeysOutput) SetKeys(v []*KeyListEntry) *ListKeysOutput { s.Keys = v return s } // SetNextMarker sets the NextMarker field's value. func (s *ListKeysOutput) SetNextMarker(v string) *ListKeysOutput { s.NextMarker = &v return s } // SetTruncated sets the Truncated field's value. func (s *ListKeysOutput) SetTruncated(v bool) *ListKeysOutput { s.Truncated = &v return s } type ListResourceTagsInput struct { _ struct{} `type:"structure"` // Gets tags on the specified KMS key. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // Use this parameter to specify the maximum number of items to return. When // this value is present, KMS does not return more than the specified number // of items, but it might return fewer. // // This value is optional. If you include a value, it must be between 1 and // 50, inclusive. If you do not include a value, it defaults to 50. Limit *int64 `min:"1" type:"integer"` // Use this parameter in a subsequent request after you receive a response with // truncated results. Set it to the value of NextMarker from the truncated response // you just received. // // Do not attempt to construct this value. Use only the value of NextMarker // from the truncated response you just received. Marker *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListResourceTagsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListResourceTagsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *ListResourceTagsInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ListResourceTagsInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.Limit != nil && *s.Limit < 1 { invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) } if s.Marker != nil && len(*s.Marker) < 1 { invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *ListResourceTagsInput) SetKeyId(v string) *ListResourceTagsInput { s.KeyId = &v return s } // SetLimit sets the Limit field's value. func (s *ListResourceTagsInput) SetLimit(v int64) *ListResourceTagsInput { s.Limit = &v return s } // SetMarker sets the Marker field's value. func (s *ListResourceTagsInput) SetMarker(v string) *ListResourceTagsInput { s.Marker = &v return s } type ListResourceTagsOutput struct { _ struct{} `type:"structure"` // When Truncated is true, this element is present and contains the value to // use for the Marker parameter in a subsequent request. // // Do not assume or infer any information from this value. NextMarker *string `min:"1" type:"string"` // A list of tags. Each tag consists of a tag key and a tag value. // // Tagging or untagging a KMS key can allow or deny permission to the KMS key. // For details, see ABAC for KMS (path_to_url // in the Key Management Service Developer Guide. Tags []*Tag `type:"list"` // A flag that indicates whether there are more items in the list. When this // value is true, the list in this response is truncated. To get more items, // pass the value of the NextMarker element in thisresponse to the Marker parameter // in a subsequent request. Truncated *bool `type:"boolean"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListResourceTagsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListResourceTagsOutput) GoString() string { return s.String() } // SetNextMarker sets the NextMarker field's value. func (s *ListResourceTagsOutput) SetNextMarker(v string) *ListResourceTagsOutput { s.NextMarker = &v return s } // SetTags sets the Tags field's value. func (s *ListResourceTagsOutput) SetTags(v []*Tag) *ListResourceTagsOutput { s.Tags = v return s } // SetTruncated sets the Truncated field's value. func (s *ListResourceTagsOutput) SetTruncated(v bool) *ListResourceTagsOutput { s.Truncated = &v return s } type ListRetirableGrantsInput struct { _ struct{} `type:"structure"` // Use this parameter to specify the maximum number of items to return. When // this value is present, KMS does not return more than the specified number // of items, but it might return fewer. // // This value is optional. If you include a value, it must be between 1 and // 100, inclusive. If you do not include a value, it defaults to 50. Limit *int64 `min:"1" type:"integer"` // Use this parameter in a subsequent request after you receive a response with // truncated results. Set it to the value of NextMarker from the truncated response // you just received. Marker *string `min:"1" type:"string"` // The retiring principal for which to list grants. Enter a principal in your // Amazon Web Services account. // // To specify the retiring principal, use the Amazon Resource Name (ARN) (path_to_url // of an Amazon Web Services principal. Valid principals include Amazon Web // Services accounts, IAM users, IAM roles, federated users, and assumed role // users. For help with the ARN syntax for a principal, see IAM ARNs (path_to_url#identifiers-arns) // in the Identity and Access Management User Guide . // // RetiringPrincipal is a required field RetiringPrincipal *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListRetirableGrantsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListRetirableGrantsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *ListRetirableGrantsInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ListRetirableGrantsInput"} if s.Limit != nil && *s.Limit < 1 { invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) } if s.Marker != nil && len(*s.Marker) < 1 { invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) } if s.RetiringPrincipal == nil { invalidParams.Add(request.NewErrParamRequired("RetiringPrincipal")) } if s.RetiringPrincipal != nil && len(*s.RetiringPrincipal) < 1 { invalidParams.Add(request.NewErrParamMinLen("RetiringPrincipal", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetLimit sets the Limit field's value. func (s *ListRetirableGrantsInput) SetLimit(v int64) *ListRetirableGrantsInput { s.Limit = &v return s } // SetMarker sets the Marker field's value. func (s *ListRetirableGrantsInput) SetMarker(v string) *ListRetirableGrantsInput { s.Marker = &v return s } // SetRetiringPrincipal sets the RetiringPrincipal field's value. func (s *ListRetirableGrantsInput) SetRetiringPrincipal(v string) *ListRetirableGrantsInput { s.RetiringPrincipal = &v return s } // The request was rejected because the specified policy is not syntactically // or semantically correct. type MalformedPolicyDocumentException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s MalformedPolicyDocumentException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s MalformedPolicyDocumentException) GoString() string { return s.String() } func newErrorMalformedPolicyDocumentException(v protocol.ResponseMetadata) error { return &MalformedPolicyDocumentException{ RespMetadata: v, } } // Code returns the exception type name. func (s *MalformedPolicyDocumentException) Code() string { return "MalformedPolicyDocumentException" } // Message returns the exception's message. func (s *MalformedPolicyDocumentException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *MalformedPolicyDocumentException) OrigErr() error { return nil } func (s *MalformedPolicyDocumentException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *MalformedPolicyDocumentException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *MalformedPolicyDocumentException) RequestID() string { return s.RespMetadata.RequestID } // Describes the configuration of this multi-Region key. This field appears // only when the KMS key is a primary or replica of a multi-Region key. // // For more information about any listed KMS key, use the DescribeKey operation. type MultiRegionConfiguration struct { _ struct{} `type:"structure"` // Indicates whether the KMS key is a PRIMARY or REPLICA key. MultiRegionKeyType *string `type:"string" enum:"MultiRegionKeyType"` // Displays the key ARN and Region of the primary key. This field includes the // current KMS key if it is the primary key. PrimaryKey *MultiRegionKey `type:"structure"` // displays the key ARNs and Regions of all replica keys. This field includes // the current KMS key if it is a replica key. ReplicaKeys []*MultiRegionKey `type:"list"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s MultiRegionConfiguration) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s MultiRegionConfiguration) GoString() string { return s.String() } // SetMultiRegionKeyType sets the MultiRegionKeyType field's value. func (s *MultiRegionConfiguration) SetMultiRegionKeyType(v string) *MultiRegionConfiguration { s.MultiRegionKeyType = &v return s } // SetPrimaryKey sets the PrimaryKey field's value. func (s *MultiRegionConfiguration) SetPrimaryKey(v *MultiRegionKey) *MultiRegionConfiguration { s.PrimaryKey = v return s } // SetReplicaKeys sets the ReplicaKeys field's value. func (s *MultiRegionConfiguration) SetReplicaKeys(v []*MultiRegionKey) *MultiRegionConfiguration { s.ReplicaKeys = v return s } // Describes the primary or replica key in a multi-Region key. type MultiRegionKey struct { _ struct{} `type:"structure"` // Displays the key ARN of a primary or replica key of a multi-Region key. Arn *string `min:"20" type:"string"` // Displays the Amazon Web Services Region of a primary or replica key in a // multi-Region key. Region *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s MultiRegionKey) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s MultiRegionKey) GoString() string { return s.String() } // SetArn sets the Arn field's value. func (s *MultiRegionKey) SetArn(v string) *MultiRegionKey { s.Arn = &v return s } // SetRegion sets the Region field's value. func (s *MultiRegionKey) SetRegion(v string) *MultiRegionKey { s.Region = &v return s } // The request was rejected because the specified entity or resource could not // be found. type NotFoundException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s NotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s NotFoundException) GoString() string { return s.String() } func newErrorNotFoundException(v protocol.ResponseMetadata) error { return &NotFoundException{ RespMetadata: v, } } // Code returns the exception type name. func (s *NotFoundException) Code() string { return "NotFoundException" } // Message returns the exception's message. func (s *NotFoundException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *NotFoundException) OrigErr() error { return nil } func (s *NotFoundException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *NotFoundException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *NotFoundException) RequestID() string { return s.RespMetadata.RequestID } type PutKeyPolicyInput struct { _ struct{} `type:"structure"` // Skips ("bypasses") the key policy lockout safety check. The default value // is false. // // Setting this value to true increases the risk that the KMS key becomes unmanageable. // Do not set this value to true indiscriminately. // // For more information, see Default key policy (path_to_url#prevent-unmanageable-key) // in the Key Management Service Developer Guide. // // Use this parameter only when you intend to prevent the principal that is // making the request from making a subsequent PutKeyPolicy (path_to_url // request on the KMS key. BypassPolicyLockoutSafetyCheck *bool `type:"boolean"` // Sets the key policy on the specified KMS key. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // The key policy to attach to the KMS key. // // The key policy must meet the following criteria: // // * The key policy must allow the calling principal to make a subsequent // PutKeyPolicy request on the KMS key. This reduces the risk that the KMS // key becomes unmanageable. For more information, see Default key policy // (path_to_url#prevent-unmanageable-key) // in the Key Management Service Developer Guide. (To omit this condition, // set BypassPolicyLockoutSafetyCheck to true.) // // * Each statement in the key policy must contain one or more principals. // The principals in the key policy must exist and be visible to KMS. When // you create a new Amazon Web Services principal, you might need to enforce // a delay before including the new principal in a key policy because the // new principal might not be immediately visible to KMS. For more information, // see Changes that I make are not always immediately visible (path_to_url#troubleshoot_general_eventual-consistency) // in the Amazon Web Services Identity and Access Management User Guide. // // A key policy document can include only the following characters: // // * Printable ASCII characters from the space character (\u0020) through // the end of the ASCII character range. // // * Printable characters in the Basic Latin and Latin-1 Supplement character // set (through \u00FF). // // * The tab (\u0009), line feed (\u000A), and carriage return (\u000D) special // characters // // For information about key policies, see Key policies in KMS (path_to_url // in the Key Management Service Developer Guide.For help writing and formatting // a JSON policy document, see the IAM JSON Policy Reference (path_to_url // in the Identity and Access Management User Guide . // // Policy is a required field Policy *string `min:"1" type:"string" required:"true"` // The name of the key policy. If no policy name is specified, the default value // is default. The only valid value is default. PolicyName *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s PutKeyPolicyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s PutKeyPolicyInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *PutKeyPolicyInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "PutKeyPolicyInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.Policy == nil { invalidParams.Add(request.NewErrParamRequired("Policy")) } if s.Policy != nil && len(*s.Policy) < 1 { invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) } if s.PolicyName != nil && len(*s.PolicyName) < 1 { invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetBypassPolicyLockoutSafetyCheck sets the BypassPolicyLockoutSafetyCheck field's value. func (s *PutKeyPolicyInput) SetBypassPolicyLockoutSafetyCheck(v bool) *PutKeyPolicyInput { s.BypassPolicyLockoutSafetyCheck = &v return s } // SetKeyId sets the KeyId field's value. func (s *PutKeyPolicyInput) SetKeyId(v string) *PutKeyPolicyInput { s.KeyId = &v return s } // SetPolicy sets the Policy field's value. func (s *PutKeyPolicyInput) SetPolicy(v string) *PutKeyPolicyInput { s.Policy = &v return s } // SetPolicyName sets the PolicyName field's value. func (s *PutKeyPolicyInput) SetPolicyName(v string) *PutKeyPolicyInput { s.PolicyName = &v return s } type PutKeyPolicyOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s PutKeyPolicyOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s PutKeyPolicyOutput) GoString() string { return s.String() } type ReEncryptInput struct { _ struct{} `type:"structure"` // Ciphertext of the data to reencrypt. // CiphertextBlob is automatically base64 encoded/decoded by the SDK. // // CiphertextBlob is a required field CiphertextBlob []byte `min:"1" type:"blob" required:"true"` // Specifies the encryption algorithm that KMS will use to reecrypt the data // after it has decrypted it. The default value, SYMMETRIC_DEFAULT, represents // the encryption algorithm used for symmetric encryption KMS keys. // // This parameter is required only when the destination KMS key is an asymmetric // KMS key. DestinationEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` // Specifies that encryption context to use when the reencrypting the data. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // A destination encryption context is valid only when the destination KMS key // is a symmetric encryption KMS key. The standard ciphertext format for asymmetric // KMS keys does not include fields for metadata. // // An encryption context is a collection of non-secret key-value pairs that // represent additional authenticated data. When you use an encryption context // to encrypt data, you must specify the same (an exact case-sensitive match) // encryption context to decrypt the data. An encryption context is supported // only on operations with symmetric encryption KMS keys. On operations with // symmetric encryption KMS keys, an encryption context is optional, but it // is strongly recommended. // // For more information, see Encryption context (path_to_url#encrypt_context) // in the Key Management Service Developer Guide. DestinationEncryptionContext map[string]*string `type:"map"` // A unique identifier for the KMS key that is used to reencrypt the data. Specify // a symmetric encryption KMS key or an asymmetric KMS key with a KeyUsage value // of ENCRYPT_DECRYPT. To find the KeyUsage value of a KMS key, use the DescribeKey // operation. // // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. // When using an alias name, prefix it with "alias/". To specify a KMS key in // a different Amazon Web Services account, you must use the key ARN or alias // ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // * Alias name: alias/ExampleAlias // // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // To get the alias name and alias ARN, use ListAliases. // // DestinationKeyId is a required field DestinationKeyId *string `min:"1" type:"string" required:"true"` // Checks if your request will succeed. DryRun is an optional parameter. // // To learn more about how to use this parameter, see Testing your KMS API calls // (path_to_url // in the Key Management Service Developer Guide. DryRun *bool `type:"boolean"` // A list of grant tokens. // // Use a grant token when your permission to call this operation comes from // a new grant that has not yet achieved eventual consistency. For more information, // see Grant token (path_to_url#grant_token) // and Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // Specifies the encryption algorithm that KMS will use to decrypt the ciphertext // before it is reencrypted. The default value, SYMMETRIC_DEFAULT, represents // the algorithm used for symmetric encryption KMS keys. // // Specify the same algorithm that was used to encrypt the ciphertext. If you // specify a different algorithm, the decrypt attempt fails. // // This parameter is required only when the ciphertext was encrypted under an // asymmetric KMS key. SourceEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` // Specifies the encryption context to use to decrypt the ciphertext. Enter // the same encryption context that was used to encrypt the ciphertext. // // An encryption context is a collection of non-secret key-value pairs that // represent additional authenticated data. When you use an encryption context // to encrypt data, you must specify the same (an exact case-sensitive match) // encryption context to decrypt the data. An encryption context is supported // only on operations with symmetric encryption KMS keys. On operations with // symmetric encryption KMS keys, an encryption context is optional, but it // is strongly recommended. // // For more information, see Encryption context (path_to_url#encrypt_context) // in the Key Management Service Developer Guide. SourceEncryptionContext map[string]*string `type:"map"` // Specifies the KMS key that KMS will use to decrypt the ciphertext before // it is re-encrypted. // // Enter a key ID of the KMS key that was used to encrypt the ciphertext. If // you identify a different KMS key, the ReEncrypt operation throws an IncorrectKeyException. // // This parameter is required only when the ciphertext was encrypted under an // asymmetric KMS key. If you used a symmetric encryption KMS key, KMS can get // the KMS key from metadata that it adds to the symmetric ciphertext blob. // However, it is always recommended as a best practice. This practice ensures // that you use the KMS key that you intend. // // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. // When using an alias name, prefix it with "alias/". To specify a KMS key in // a different Amazon Web Services account, you must use the key ARN or alias // ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // * Alias name: alias/ExampleAlias // // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // To get the alias name and alias ARN, use ListAliases. SourceKeyId *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ReEncryptInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ReEncryptInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *ReEncryptInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ReEncryptInput"} if s.CiphertextBlob == nil { invalidParams.Add(request.NewErrParamRequired("CiphertextBlob")) } if s.CiphertextBlob != nil && len(s.CiphertextBlob) < 1 { invalidParams.Add(request.NewErrParamMinLen("CiphertextBlob", 1)) } if s.DestinationKeyId == nil { invalidParams.Add(request.NewErrParamRequired("DestinationKeyId")) } if s.DestinationKeyId != nil && len(*s.DestinationKeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("DestinationKeyId", 1)) } if s.SourceKeyId != nil && len(*s.SourceKeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("SourceKeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetCiphertextBlob sets the CiphertextBlob field's value. func (s *ReEncryptInput) SetCiphertextBlob(v []byte) *ReEncryptInput { s.CiphertextBlob = v return s } // SetDestinationEncryptionAlgorithm sets the DestinationEncryptionAlgorithm field's value. func (s *ReEncryptInput) SetDestinationEncryptionAlgorithm(v string) *ReEncryptInput { s.DestinationEncryptionAlgorithm = &v return s } // SetDestinationEncryptionContext sets the DestinationEncryptionContext field's value. func (s *ReEncryptInput) SetDestinationEncryptionContext(v map[string]*string) *ReEncryptInput { s.DestinationEncryptionContext = v return s } // SetDestinationKeyId sets the DestinationKeyId field's value. func (s *ReEncryptInput) SetDestinationKeyId(v string) *ReEncryptInput { s.DestinationKeyId = &v return s } // SetDryRun sets the DryRun field's value. func (s *ReEncryptInput) SetDryRun(v bool) *ReEncryptInput { s.DryRun = &v return s } // SetGrantTokens sets the GrantTokens field's value. func (s *ReEncryptInput) SetGrantTokens(v []*string) *ReEncryptInput { s.GrantTokens = v return s } // SetSourceEncryptionAlgorithm sets the SourceEncryptionAlgorithm field's value. func (s *ReEncryptInput) SetSourceEncryptionAlgorithm(v string) *ReEncryptInput { s.SourceEncryptionAlgorithm = &v return s } // SetSourceEncryptionContext sets the SourceEncryptionContext field's value. func (s *ReEncryptInput) SetSourceEncryptionContext(v map[string]*string) *ReEncryptInput { s.SourceEncryptionContext = v return s } // SetSourceKeyId sets the SourceKeyId field's value. func (s *ReEncryptInput) SetSourceKeyId(v string) *ReEncryptInput { s.SourceKeyId = &v return s } type ReEncryptOutput struct { _ struct{} `type:"structure"` // The reencrypted data. When you use the HTTP API or the Amazon Web Services // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. // CiphertextBlob is automatically base64 encoded/decoded by the SDK. CiphertextBlob []byte `min:"1" type:"blob"` // The encryption algorithm that was used to reencrypt the data. DestinationEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` // The Amazon Resource Name (key ARN (path_to_url#key-id-key-ARN)) // of the KMS key that was used to reencrypt the data. KeyId *string `min:"1" type:"string"` // The encryption algorithm that was used to decrypt the ciphertext before it // was reencrypted. SourceEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` // Unique identifier of the KMS key used to originally encrypt the data. SourceKeyId *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ReEncryptOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ReEncryptOutput) GoString() string { return s.String() } // SetCiphertextBlob sets the CiphertextBlob field's value. func (s *ReEncryptOutput) SetCiphertextBlob(v []byte) *ReEncryptOutput { s.CiphertextBlob = v return s } // SetDestinationEncryptionAlgorithm sets the DestinationEncryptionAlgorithm field's value. func (s *ReEncryptOutput) SetDestinationEncryptionAlgorithm(v string) *ReEncryptOutput { s.DestinationEncryptionAlgorithm = &v return s } // SetKeyId sets the KeyId field's value. func (s *ReEncryptOutput) SetKeyId(v string) *ReEncryptOutput { s.KeyId = &v return s } // SetSourceEncryptionAlgorithm sets the SourceEncryptionAlgorithm field's value. func (s *ReEncryptOutput) SetSourceEncryptionAlgorithm(v string) *ReEncryptOutput { s.SourceEncryptionAlgorithm = &v return s } // SetSourceKeyId sets the SourceKeyId field's value. func (s *ReEncryptOutput) SetSourceKeyId(v string) *ReEncryptOutput { s.SourceKeyId = &v return s } // Contains information about the party that receives the response from the // API operation. // // This data type is designed to support Amazon Web Services Nitro Enclaves, // which lets you create an isolated compute environment in Amazon EC2. For // information about the interaction between KMS and Amazon Web Services Nitro // Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS (path_to_url // in the Key Management Service Developer Guide. type RecipientInfo struct { _ struct{} `type:"structure"` // The attestation document for an Amazon Web Services Nitro Enclave. This document // includes the enclave's public key. // AttestationDocument is automatically base64 encoded/decoded by the SDK. AttestationDocument []byte `min:"1" type:"blob"` // The encryption algorithm that KMS should use with the public key for an Amazon // Web Services Nitro Enclave to encrypt plaintext values for the response. // The only valid value is RSAES_OAEP_SHA_256. KeyEncryptionAlgorithm *string `type:"string" enum:"KeyEncryptionMechanism"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s RecipientInfo) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s RecipientInfo) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *RecipientInfo) Validate() error { invalidParams := request.ErrInvalidParams{Context: "RecipientInfo"} if s.AttestationDocument != nil && len(s.AttestationDocument) < 1 { invalidParams.Add(request.NewErrParamMinLen("AttestationDocument", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetAttestationDocument sets the AttestationDocument field's value. func (s *RecipientInfo) SetAttestationDocument(v []byte) *RecipientInfo { s.AttestationDocument = v return s } // SetKeyEncryptionAlgorithm sets the KeyEncryptionAlgorithm field's value. func (s *RecipientInfo) SetKeyEncryptionAlgorithm(v string) *RecipientInfo { s.KeyEncryptionAlgorithm = &v return s } type ReplicateKeyInput struct { _ struct{} `type:"structure"` // Skips ("bypasses") the key policy lockout safety check. The default value // is false. // // Setting this value to true increases the risk that the KMS key becomes unmanageable. // Do not set this value to true indiscriminately. // // For more information, see Default key policy (path_to_url#prevent-unmanageable-key) // in the Key Management Service Developer Guide. // // Use this parameter only when you intend to prevent the principal that is // making the request from making a subsequent PutKeyPolicy (path_to_url // request on the KMS key. BypassPolicyLockoutSafetyCheck *bool `type:"boolean"` // A description of the KMS key. The default value is an empty string (no description). // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // The description is not a shared property of multi-Region keys. You can specify // the same description or a different description for each key in a set of // related multi-Region keys. KMS does not synchronize this property. Description *string `type:"string"` // Identifies the multi-Region primary key that is being replicated. To determine // whether a KMS key is a multi-Region primary key, use the DescribeKey operation // to check the value of the MultiRegionKeyType property. // // Specify the key ID or key ARN of a multi-Region primary key. // // For example: // // * Key ID: mrk-1234abcd12ab34cd56ef1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // The key policy to attach to the KMS key. This parameter is optional. If you // do not provide a key policy, KMS attaches the default key policy (path_to_url#key-policy-default) // to the KMS key. // // The key policy is not a shared property of multi-Region keys. You can specify // the same key policy or a different key policy for each key in a set of related // multi-Region keys. KMS does not synchronize this property. // // If you provide a key policy, it must meet the following criteria: // // * The key policy must allow the calling principal to make a subsequent // PutKeyPolicy request on the KMS key. This reduces the risk that the KMS // key becomes unmanageable. For more information, see Default key policy // (path_to_url#prevent-unmanageable-key) // in the Key Management Service Developer Guide. (To omit this condition, // set BypassPolicyLockoutSafetyCheck to true.) // // * Each statement in the key policy must contain one or more principals. // The principals in the key policy must exist and be visible to KMS. When // you create a new Amazon Web Services principal, you might need to enforce // a delay before including the new principal in a key policy because the // new principal might not be immediately visible to KMS. For more information, // see Changes that I make are not always immediately visible (path_to_url#troubleshoot_general_eventual-consistency) // in the Amazon Web Services Identity and Access Management User Guide. // // A key policy document can include only the following characters: // // * Printable ASCII characters from the space character (\u0020) through // the end of the ASCII character range. // // * Printable characters in the Basic Latin and Latin-1 Supplement character // set (through \u00FF). // // * The tab (\u0009), line feed (\u000A), and carriage return (\u000D) special // characters // // For information about key policies, see Key policies in KMS (path_to_url // in the Key Management Service Developer Guide. For help writing and formatting // a JSON policy document, see the IAM JSON Policy Reference (path_to_url // in the Identity and Access Management User Guide . Policy *string `min:"1" type:"string"` // The Region ID of the Amazon Web Services Region for this replica key. // // Enter the Region ID, such as us-east-1 or ap-southeast-2. For a list of Amazon // Web Services Regions in which KMS is supported, see KMS service endpoints // (path_to_url#kms_region) in the // Amazon Web Services General Reference. // // HMAC KMS keys are not supported in all Amazon Web Services Regions. If you // try to replicate an HMAC KMS key in an Amazon Web Services Region in which // HMAC keys are not supported, the ReplicateKey operation returns an UnsupportedOperationException. // For a list of Regions in which HMAC KMS keys are supported, see HMAC keys // in KMS (path_to_url // in the Key Management Service Developer Guide. // // The replica must be in a different Amazon Web Services Region than its primary // key and other replicas of that primary key, but in the same Amazon Web Services // partition. KMS must be available in the replica Region. If the Region is // not enabled by default, the Amazon Web Services account must be enabled in // the Region. For information about Amazon Web Services partitions, see Amazon // Resource Names (ARNs) (path_to_url // in the Amazon Web Services General Reference. For information about enabling // and disabling Regions, see Enabling a Region (path_to_url#rande-manage-enable) // and Disabling a Region (path_to_url#rande-manage-disable) // in the Amazon Web Services General Reference. // // ReplicaRegion is a required field ReplicaRegion *string `min:"1" type:"string" required:"true"` // Assigns one or more tags to the replica key. Use this parameter to tag the // KMS key when it is created. To tag an existing KMS key, use the TagResource // operation. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // Tagging or untagging a KMS key can allow or deny permission to the KMS key. // For details, see ABAC for KMS (path_to_url // in the Key Management Service Developer Guide. // // To use this parameter, you must have kms:TagResource (path_to_url // permission in an IAM policy. // // Tags are not a shared property of multi-Region keys. You can specify the // same tags or different tags for each key in a set of related multi-Region // keys. KMS does not synchronize this property. // // Each tag consists of a tag key and a tag value. Both the tag key and the // tag value are required, but the tag value can be an empty (null) string. // You cannot have more than one tag on a KMS key with the same tag key. If // you specify an existing tag key with a different tag value, KMS replaces // the current tag value with the specified one. // // When you add tags to an Amazon Web Services resource, Amazon Web Services // generates a cost allocation report with usage and costs aggregated by tags. // Tags can also be used to control access to a KMS key. For details, see Tagging // Keys (path_to_url Tags []*Tag `type:"list"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ReplicateKeyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ReplicateKeyInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *ReplicateKeyInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ReplicateKeyInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.Policy != nil && len(*s.Policy) < 1 { invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) } if s.ReplicaRegion == nil { invalidParams.Add(request.NewErrParamRequired("ReplicaRegion")) } if s.ReplicaRegion != nil && len(*s.ReplicaRegion) < 1 { invalidParams.Add(request.NewErrParamMinLen("ReplicaRegion", 1)) } if s.Tags != nil { for i, v := range s.Tags { if v == nil { continue } if err := v.Validate(); err != nil { invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) } } } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetBypassPolicyLockoutSafetyCheck sets the BypassPolicyLockoutSafetyCheck field's value. func (s *ReplicateKeyInput) SetBypassPolicyLockoutSafetyCheck(v bool) *ReplicateKeyInput { s.BypassPolicyLockoutSafetyCheck = &v return s } // SetDescription sets the Description field's value. func (s *ReplicateKeyInput) SetDescription(v string) *ReplicateKeyInput { s.Description = &v return s } // SetKeyId sets the KeyId field's value. func (s *ReplicateKeyInput) SetKeyId(v string) *ReplicateKeyInput { s.KeyId = &v return s } // SetPolicy sets the Policy field's value. func (s *ReplicateKeyInput) SetPolicy(v string) *ReplicateKeyInput { s.Policy = &v return s } // SetReplicaRegion sets the ReplicaRegion field's value. func (s *ReplicateKeyInput) SetReplicaRegion(v string) *ReplicateKeyInput { s.ReplicaRegion = &v return s } // SetTags sets the Tags field's value. func (s *ReplicateKeyInput) SetTags(v []*Tag) *ReplicateKeyInput { s.Tags = v return s } type ReplicateKeyOutput struct { _ struct{} `type:"structure"` // Displays details about the new replica key, including its Amazon Resource // Name (key ARN (path_to_url#key-id-key-ARN)) // and Key states of KMS keys (path_to_url // It also includes the ARN and Amazon Web Services Region of its primary key // and other replica keys. ReplicaKeyMetadata *KeyMetadata `type:"structure"` // The key policy of the new replica key. The value is a key policy document // in JSON format. ReplicaPolicy *string `min:"1" type:"string"` // The tags on the new replica key. The value is a list of tag key and tag value // pairs. ReplicaTags []*Tag `type:"list"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ReplicateKeyOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ReplicateKeyOutput) GoString() string { return s.String() } // SetReplicaKeyMetadata sets the ReplicaKeyMetadata field's value. func (s *ReplicateKeyOutput) SetReplicaKeyMetadata(v *KeyMetadata) *ReplicateKeyOutput { s.ReplicaKeyMetadata = v return s } // SetReplicaPolicy sets the ReplicaPolicy field's value. func (s *ReplicateKeyOutput) SetReplicaPolicy(v string) *ReplicateKeyOutput { s.ReplicaPolicy = &v return s } // SetReplicaTags sets the ReplicaTags field's value. func (s *ReplicateKeyOutput) SetReplicaTags(v []*Tag) *ReplicateKeyOutput { s.ReplicaTags = v return s } type RetireGrantInput struct { _ struct{} `type:"structure"` // Checks if your request will succeed. DryRun is an optional parameter. // // To learn more about how to use this parameter, see Testing your KMS API calls // (path_to_url // in the Key Management Service Developer Guide. DryRun *bool `type:"boolean"` // Identifies the grant to retire. To get the grant ID, use CreateGrant, ListGrants, // or ListRetirableGrants. // // * Grant ID Example - your_sha256_hash GrantId *string `min:"1" type:"string"` // Identifies the grant to be retired. You can use a grant token to identify // a new grant even before it has achieved eventual consistency. // // Only the CreateGrant operation returns a grant token. For details, see Grant // token (path_to_url#grant_token) // and Eventual consistency (path_to_url#terms-eventual-consistency) // in the Key Management Service Developer Guide. GrantToken *string `min:"1" type:"string"` // The key ARN KMS key associated with the grant. To find the key ARN, use the // ListKeys operation. // // For example: arn:aws:kms:us-east-2:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab KeyId *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s RetireGrantInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s RetireGrantInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *RetireGrantInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "RetireGrantInput"} if s.GrantId != nil && len(*s.GrantId) < 1 { invalidParams.Add(request.NewErrParamMinLen("GrantId", 1)) } if s.GrantToken != nil && len(*s.GrantToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("GrantToken", 1)) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetDryRun sets the DryRun field's value. func (s *RetireGrantInput) SetDryRun(v bool) *RetireGrantInput { s.DryRun = &v return s } // SetGrantId sets the GrantId field's value. func (s *RetireGrantInput) SetGrantId(v string) *RetireGrantInput { s.GrantId = &v return s } // SetGrantToken sets the GrantToken field's value. func (s *RetireGrantInput) SetGrantToken(v string) *RetireGrantInput { s.GrantToken = &v return s } // SetKeyId sets the KeyId field's value. func (s *RetireGrantInput) SetKeyId(v string) *RetireGrantInput { s.KeyId = &v return s } type RetireGrantOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s RetireGrantOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s RetireGrantOutput) GoString() string { return s.String() } type RevokeGrantInput struct { _ struct{} `type:"structure"` // Checks if your request will succeed. DryRun is an optional parameter. // // To learn more about how to use this parameter, see Testing your KMS API calls // (path_to_url // in the Key Management Service Developer Guide. DryRun *bool `type:"boolean"` // Identifies the grant to revoke. To get the grant ID, use CreateGrant, ListGrants, // or ListRetirableGrants. // // GrantId is a required field GrantId *string `min:"1" type:"string" required:"true"` // A unique identifier for the KMS key associated with the grant. To get the // key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // Specify the key ID or key ARN of the KMS key. To specify a KMS key in a different // Amazon Web Services account, you must use the key ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s RevokeGrantInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s RevokeGrantInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *RevokeGrantInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "RevokeGrantInput"} if s.GrantId == nil { invalidParams.Add(request.NewErrParamRequired("GrantId")) } if s.GrantId != nil && len(*s.GrantId) < 1 { invalidParams.Add(request.NewErrParamMinLen("GrantId", 1)) } if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetDryRun sets the DryRun field's value. func (s *RevokeGrantInput) SetDryRun(v bool) *RevokeGrantInput { s.DryRun = &v return s } // SetGrantId sets the GrantId field's value. func (s *RevokeGrantInput) SetGrantId(v string) *RevokeGrantInput { s.GrantId = &v return s } // SetKeyId sets the KeyId field's value. func (s *RevokeGrantInput) SetKeyId(v string) *RevokeGrantInput { s.KeyId = &v return s } type RevokeGrantOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s RevokeGrantOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s RevokeGrantOutput) GoString() string { return s.String() } type ScheduleKeyDeletionInput struct { _ struct{} `type:"structure"` // The unique identifier of the KMS key to delete. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // The waiting period, specified in number of days. After the waiting period // ends, KMS deletes the KMS key. // // If the KMS key is a multi-Region primary key with replica keys, the waiting // period begins when the last of its replica keys is deleted. Otherwise, the // waiting period begins immediately. // // This value is optional. If you include a value, it must be between 7 and // 30, inclusive. If you do not include a value, it defaults to 30. You can // use the kms:ScheduleKeyDeletionPendingWindowInDays (path_to_url#conditions-kms-schedule-key-deletion-pending-window-in-days) // condition key to further constrain the values that principals can specify // in the PendingWindowInDays parameter. PendingWindowInDays *int64 `min:"1" type:"integer"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ScheduleKeyDeletionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ScheduleKeyDeletionInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *ScheduleKeyDeletionInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ScheduleKeyDeletionInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.PendingWindowInDays != nil && *s.PendingWindowInDays < 1 { invalidParams.Add(request.NewErrParamMinValue("PendingWindowInDays", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *ScheduleKeyDeletionInput) SetKeyId(v string) *ScheduleKeyDeletionInput { s.KeyId = &v return s } // SetPendingWindowInDays sets the PendingWindowInDays field's value. func (s *ScheduleKeyDeletionInput) SetPendingWindowInDays(v int64) *ScheduleKeyDeletionInput { s.PendingWindowInDays = &v return s } type ScheduleKeyDeletionOutput struct { _ struct{} `type:"structure"` // The date and time after which KMS deletes the KMS key. // // If the KMS key is a multi-Region primary key with replica keys, this field // does not appear. The deletion date for the primary key isn't known until // its last replica key is deleted. DeletionDate *time.Time `type:"timestamp"` // The Amazon Resource Name (key ARN (path_to_url#key-id-key-ARN)) // of the KMS key whose deletion is scheduled. KeyId *string `min:"1" type:"string"` // The current status of the KMS key. // // For more information about how key state affects the use of a KMS key, see // Key states of KMS keys (path_to_url // in the Key Management Service Developer Guide. KeyState *string `type:"string" enum:"KeyState"` // The waiting period before the KMS key is deleted. // // If the KMS key is a multi-Region primary key with replicas, the waiting period // begins when the last of its replica keys is deleted. Otherwise, the waiting // period begins immediately. PendingWindowInDays *int64 `min:"1" type:"integer"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ScheduleKeyDeletionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ScheduleKeyDeletionOutput) GoString() string { return s.String() } // SetDeletionDate sets the DeletionDate field's value. func (s *ScheduleKeyDeletionOutput) SetDeletionDate(v time.Time) *ScheduleKeyDeletionOutput { s.DeletionDate = &v return s } // SetKeyId sets the KeyId field's value. func (s *ScheduleKeyDeletionOutput) SetKeyId(v string) *ScheduleKeyDeletionOutput { s.KeyId = &v return s } // SetKeyState sets the KeyState field's value. func (s *ScheduleKeyDeletionOutput) SetKeyState(v string) *ScheduleKeyDeletionOutput { s.KeyState = &v return s } // SetPendingWindowInDays sets the PendingWindowInDays field's value. func (s *ScheduleKeyDeletionOutput) SetPendingWindowInDays(v int64) *ScheduleKeyDeletionOutput { s.PendingWindowInDays = &v return s } type SignInput struct { _ struct{} `type:"structure"` // Checks if your request will succeed. DryRun is an optional parameter. // // To learn more about how to use this parameter, see Testing your KMS API calls // (path_to_url // in the Key Management Service Developer Guide. DryRun *bool `type:"boolean"` // A list of grant tokens. // // Use a grant token when your permission to call this operation comes from // a new grant that has not yet achieved eventual consistency. For more information, // see Grant token (path_to_url#grant_token) // and Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // Identifies an asymmetric KMS key. KMS uses the private key in the asymmetric // KMS key to sign the message. The KeyUsage type of the KMS key must be SIGN_VERIFY. // To find the KeyUsage of a KMS key, use the DescribeKey operation. // // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. // When using an alias name, prefix it with "alias/". To specify a KMS key in // a different Amazon Web Services account, you must use the key ARN or alias // ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // * Alias name: alias/ExampleAlias // // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // To get the alias name and alias ARN, use ListAliases. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // Specifies the message or message digest to sign. Messages can be 0-4096 bytes. // To sign a larger message, provide a message digest. // // If you provide a message digest, use the DIGEST value of MessageType to prevent // the digest from being hashed again while signing. // // Message is a sensitive parameter and its value will be // replaced with "sensitive" in string returned by SignInput's // String and GoString methods. // // Message is automatically base64 encoded/decoded by the SDK. // // Message is a required field Message []byte `min:"1" type:"blob" required:"true" sensitive:"true"` // Tells KMS whether the value of the Message parameter should be hashed as // part of the signing algorithm. Use RAW for unhashed messages; use DIGEST // for message digests, which are already hashed. // // When the value of MessageType is RAW, KMS uses the standard signing algorithm, // which begins with a hash function. When the value is DIGEST, KMS skips the // hashing step in the signing algorithm. // // Use the DIGEST value only when the value of the Message parameter is a message // digest. If you use the DIGEST value with an unhashed message, the security // of the signing operation can be compromised. // // When the value of MessageTypeis DIGEST, the length of the Message value must // match the length of hashed messages for the specified signing algorithm. // // You can submit a message digest and omit the MessageType or specify RAW so // the digest is hashed again while signing. However, this can cause verification // failures when verifying with a system that assumes a single hash. // // The hashing algorithm in that Sign uses is based on the SigningAlgorithm // value. // // * Signing algorithms that end in SHA_256 use the SHA_256 hashing algorithm. // // * Signing algorithms that end in SHA_384 use the SHA_384 hashing algorithm. // // * Signing algorithms that end in SHA_512 use the SHA_512 hashing algorithm. // // * SM2DSA uses the SM3 hashing algorithm. For details, see Offline verification // with SM2 key pairs (path_to_url#key-spec-sm-offline-verification). MessageType *string `type:"string" enum:"MessageType"` // Specifies the signing algorithm to use when signing the message. // // Choose an algorithm that is compatible with the type and size of the specified // asymmetric KMS key. When signing with RSA key pairs, RSASSA-PSS algorithms // are preferred. We include RSASSA-PKCS1-v1_5 algorithms for compatibility // with existing applications. // // SigningAlgorithm is a required field SigningAlgorithm *string `type:"string" required:"true" enum:"SigningAlgorithmSpec"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s SignInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s SignInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *SignInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "SignInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.Message == nil { invalidParams.Add(request.NewErrParamRequired("Message")) } if s.Message != nil && len(s.Message) < 1 { invalidParams.Add(request.NewErrParamMinLen("Message", 1)) } if s.SigningAlgorithm == nil { invalidParams.Add(request.NewErrParamRequired("SigningAlgorithm")) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetDryRun sets the DryRun field's value. func (s *SignInput) SetDryRun(v bool) *SignInput { s.DryRun = &v return s } // SetGrantTokens sets the GrantTokens field's value. func (s *SignInput) SetGrantTokens(v []*string) *SignInput { s.GrantTokens = v return s } // SetKeyId sets the KeyId field's value. func (s *SignInput) SetKeyId(v string) *SignInput { s.KeyId = &v return s } // SetMessage sets the Message field's value. func (s *SignInput) SetMessage(v []byte) *SignInput { s.Message = v return s } // SetMessageType sets the MessageType field's value. func (s *SignInput) SetMessageType(v string) *SignInput { s.MessageType = &v return s } // SetSigningAlgorithm sets the SigningAlgorithm field's value. func (s *SignInput) SetSigningAlgorithm(v string) *SignInput { s.SigningAlgorithm = &v return s } type SignOutput struct { _ struct{} `type:"structure"` // The Amazon Resource Name (key ARN (path_to_url#key-id-key-ARN)) // of the asymmetric KMS key that was used to sign the message. KeyId *string `min:"1" type:"string"` // The cryptographic signature that was generated for the message. // // * When used with the supported RSA signing algorithms, the encoding of // this value is defined by PKCS #1 in RFC 8017 (path_to_url // // * When used with the ECDSA_SHA_256, ECDSA_SHA_384, or ECDSA_SHA_512 signing // algorithms, this value is a DER-encoded object as defined by ANSI X9.622005 // and RFC 3279 Section 2.2.3 (path_to_url#section-2.2.3). // This is the most commonly used signature format and is appropriate for // most uses. // // When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. // Otherwise, it is not Base64-encoded. // Signature is automatically base64 encoded/decoded by the SDK. Signature []byte `min:"1" type:"blob"` // The signing algorithm that was used to sign the message. SigningAlgorithm *string `type:"string" enum:"SigningAlgorithmSpec"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s SignOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s SignOutput) GoString() string { return s.String() } // SetKeyId sets the KeyId field's value. func (s *SignOutput) SetKeyId(v string) *SignOutput { s.KeyId = &v return s } // SetSignature sets the Signature field's value. func (s *SignOutput) SetSignature(v []byte) *SignOutput { s.Signature = v return s } // SetSigningAlgorithm sets the SigningAlgorithm field's value. func (s *SignOutput) SetSigningAlgorithm(v string) *SignOutput { s.SigningAlgorithm = &v return s } // A key-value pair. A tag consists of a tag key and a tag value. Tag keys and // tag values are both required, but tag values can be empty (null) strings. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // For information about the rules that apply to tag keys and tag values, see // User-Defined Tag Restrictions (path_to_url // in the Amazon Web Services Billing and Cost Management User Guide. type Tag struct { _ struct{} `type:"structure"` // The key of the tag. // // TagKey is a required field TagKey *string `min:"1" type:"string" required:"true"` // The value of the tag. // // TagValue is a required field TagValue *string `type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s Tag) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s Tag) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *Tag) Validate() error { invalidParams := request.ErrInvalidParams{Context: "Tag"} if s.TagKey == nil { invalidParams.Add(request.NewErrParamRequired("TagKey")) } if s.TagKey != nil && len(*s.TagKey) < 1 { invalidParams.Add(request.NewErrParamMinLen("TagKey", 1)) } if s.TagValue == nil { invalidParams.Add(request.NewErrParamRequired("TagValue")) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetTagKey sets the TagKey field's value. func (s *Tag) SetTagKey(v string) *Tag { s.TagKey = &v return s } // SetTagValue sets the TagValue field's value. func (s *Tag) SetTagValue(v string) *Tag { s.TagValue = &v return s } // The request was rejected because one or more tags are not valid. type TagException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s TagException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s TagException) GoString() string { return s.String() } func newErrorTagException(v protocol.ResponseMetadata) error { return &TagException{ RespMetadata: v, } } // Code returns the exception type name. func (s *TagException) Code() string { return "TagException" } // Message returns the exception's message. func (s *TagException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *TagException) OrigErr() error { return nil } func (s *TagException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *TagException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *TagException) RequestID() string { return s.RespMetadata.RequestID } type TagResourceInput struct { _ struct{} `type:"structure"` // Identifies a customer managed key in the account and Region. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // One or more tags. Each tag consists of a tag key and a tag value. The tag // value can be an empty (null) string. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // You cannot have more than one tag on a KMS key with the same tag key. If // you specify an existing tag key with a different tag value, KMS replaces // the current tag value with the specified one. // // Tags is a required field Tags []*Tag `type:"list" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s TagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s TagResourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *TagResourceInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.Tags == nil { invalidParams.Add(request.NewErrParamRequired("Tags")) } if s.Tags != nil { for i, v := range s.Tags { if v == nil { continue } if err := v.Validate(); err != nil { invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) } } } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *TagResourceInput) SetKeyId(v string) *TagResourceInput { s.KeyId = &v return s } // SetTags sets the Tags field's value. func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { s.Tags = v return s } type TagResourceOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s TagResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s TagResourceOutput) GoString() string { return s.String() } // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. type UnsupportedOperationException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UnsupportedOperationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UnsupportedOperationException) GoString() string { return s.String() } func newErrorUnsupportedOperationException(v protocol.ResponseMetadata) error { return &UnsupportedOperationException{ RespMetadata: v, } } // Code returns the exception type name. func (s *UnsupportedOperationException) Code() string { return "UnsupportedOperationException" } // Message returns the exception's message. func (s *UnsupportedOperationException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *UnsupportedOperationException) OrigErr() error { return nil } func (s *UnsupportedOperationException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *UnsupportedOperationException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *UnsupportedOperationException) RequestID() string { return s.RespMetadata.RequestID } type UntagResourceInput struct { _ struct{} `type:"structure"` // Identifies the KMS key from which you are removing tags. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // One or more tag keys. Specify only the tag keys, not the tag values. // // TagKeys is a required field TagKeys []*string `type:"list" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UntagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UntagResourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *UntagResourceInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.TagKeys == nil { invalidParams.Add(request.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *UntagResourceInput) SetKeyId(v string) *UntagResourceInput { s.KeyId = &v return s } // SetTagKeys sets the TagKeys field's value. func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { s.TagKeys = v return s } type UntagResourceOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UntagResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UntagResourceOutput) GoString() string { return s.String() } type UpdateAliasInput struct { _ struct{} `type:"structure"` // Identifies the alias that is changing its KMS key. This value must begin // with alias/ followed by the alias name, such as alias/ExampleAlias. You cannot // use UpdateAlias to change the alias name. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // AliasName is a required field AliasName *string `min:"1" type:"string" required:"true"` // Identifies the customer managed key (path_to_url#customer-cmk) // to associate with the alias. You don't have permission to associate an alias // with an Amazon Web Services managed key (path_to_url#aws-managed-cmk). // // The KMS key must be in the same Amazon Web Services account and Region as // the alias. Also, the new target KMS key must be the same type as the current // target KMS key (both symmetric or both asymmetric or both HMAC) and they // must have the same key usage. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // To verify that the alias is mapped to the correct KMS key, use ListAliases. // // TargetKeyId is a required field TargetKeyId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdateAliasInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdateAliasInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *UpdateAliasInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "UpdateAliasInput"} if s.AliasName == nil { invalidParams.Add(request.NewErrParamRequired("AliasName")) } if s.AliasName != nil && len(*s.AliasName) < 1 { invalidParams.Add(request.NewErrParamMinLen("AliasName", 1)) } if s.TargetKeyId == nil { invalidParams.Add(request.NewErrParamRequired("TargetKeyId")) } if s.TargetKeyId != nil && len(*s.TargetKeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("TargetKeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetAliasName sets the AliasName field's value. func (s *UpdateAliasInput) SetAliasName(v string) *UpdateAliasInput { s.AliasName = &v return s } // SetTargetKeyId sets the TargetKeyId field's value. func (s *UpdateAliasInput) SetTargetKeyId(v string) *UpdateAliasInput { s.TargetKeyId = &v return s } type UpdateAliasOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdateAliasOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdateAliasOutput) GoString() string { return s.String() } type UpdateCustomKeyStoreInput struct { _ struct{} `type:"structure"` // Associates the custom key store with a related CloudHSM cluster. This parameter // is valid only for custom key stores with a CustomKeyStoreType of AWS_CLOUDHSM. // // Enter the cluster ID of the cluster that you used to create the custom key // store or a cluster that shares a backup history and has the same cluster // certificate as the original cluster. You cannot use this parameter to associate // a custom key store with an unrelated cluster. In addition, the replacement // cluster must fulfill the requirements (path_to_url#before-keystore) // for a cluster associated with a custom key store. To view the cluster certificate // of a cluster, use the DescribeClusters (path_to_url // operation. // // To change this value, the CloudHSM key store must be disconnected. CloudHsmClusterId *string `min:"19" type:"string"` // Identifies the custom key store that you want to update. Enter the ID of // the custom key store. To find the ID of a custom key store, use the DescribeCustomKeyStores // operation. // // CustomKeyStoreId is a required field CustomKeyStoreId *string `min:"1" type:"string" required:"true"` // Enter the current password of the kmsuser crypto user (CU) in the CloudHSM // cluster that is associated with the custom key store. This parameter is valid // only for custom key stores with a CustomKeyStoreType of AWS_CLOUDHSM. // // This parameter tells KMS the current password of the kmsuser crypto user // (CU). It does not set or change the password of any users in the CloudHSM // cluster. // // To change this value, the CloudHSM key store must be disconnected. // // KeyStorePassword is a sensitive parameter and its value will be // replaced with "sensitive" in string returned by UpdateCustomKeyStoreInput's // String and GoString methods. KeyStorePassword *string `min:"7" type:"string" sensitive:"true"` // Changes the friendly name of the custom key store to the value that you specify. // The custom key store name must be unique in the Amazon Web Services account. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // To change this value, an CloudHSM key store must be disconnected. An external // key store can be connected or disconnected. NewCustomKeyStoreName *string `min:"1" type:"string"` // Changes the credentials that KMS uses to sign requests to the external key // store proxy (XKS proxy). This parameter is valid only for custom key stores // with a CustomKeyStoreType of EXTERNAL_KEY_STORE. // // You must specify both the AccessKeyId and SecretAccessKey value in the authentication // credential, even if you are only updating one value. // // This parameter doesn't establish or change your authentication credentials // on the proxy. It just tells KMS the credential that you established with // your external key store proxy. For example, if you rotate the credential // on your external key store proxy, you can use this parameter to update the // credential in KMS. // // You can change this value when the external key store is connected or disconnected. XksProxyAuthenticationCredential *XksProxyAuthenticationCredentialType `type:"structure"` // Changes the connectivity setting for the external key store. To indicate // that the external key store proxy uses a Amazon VPC endpoint service to communicate // with KMS, specify VPC_ENDPOINT_SERVICE. Otherwise, specify PUBLIC_ENDPOINT. // // If you change the XksProxyConnectivity to VPC_ENDPOINT_SERVICE, you must // also change the XksProxyUriEndpoint and add an XksProxyVpcEndpointServiceName // value. // // If you change the XksProxyConnectivity to PUBLIC_ENDPOINT, you must also // change the XksProxyUriEndpoint and specify a null or empty string for the // XksProxyVpcEndpointServiceName value. // // To change this value, the external key store must be disconnected. XksProxyConnectivity *string `type:"string" enum:"XksProxyConnectivityType"` // Changes the URI endpoint that KMS uses to connect to your external key store // proxy (XKS proxy). This parameter is valid only for custom key stores with // a CustomKeyStoreType of EXTERNAL_KEY_STORE. // // For external key stores with an XksProxyConnectivity value of PUBLIC_ENDPOINT, // the protocol must be HTTPS. // // For external key stores with an XksProxyConnectivity value of VPC_ENDPOINT_SERVICE, // specify https:// followed by the private DNS name associated with the VPC // endpoint service. Each external key store must use a different private DNS // name. // // The combined XksProxyUriEndpoint and XksProxyUriPath values must be unique // in the Amazon Web Services account and Region. // // To change this value, the external key store must be disconnected. XksProxyUriEndpoint *string `min:"10" type:"string"` // Changes the base path to the proxy APIs for this external key store. To find // this value, see the documentation for your external key manager and external // key store proxy (XKS proxy). This parameter is valid only for custom key // stores with a CustomKeyStoreType of EXTERNAL_KEY_STORE. // // The value must start with / and must end with /kms/xks/v1, where v1 represents // the version of the KMS external key store proxy API. You can include an optional // prefix between the required elements such as /example/kms/xks/v1. // // The combined XksProxyUriEndpoint and XksProxyUriPath values must be unique // in the Amazon Web Services account and Region. // // You can change this value when the external key store is connected or disconnected. XksProxyUriPath *string `min:"10" type:"string"` // Changes the name that KMS uses to identify the Amazon VPC endpoint service // for your external key store proxy (XKS proxy). This parameter is valid when // the CustomKeyStoreType is EXTERNAL_KEY_STORE and the XksProxyConnectivity // is VPC_ENDPOINT_SERVICE. // // To change this value, the external key store must be disconnected. XksProxyVpcEndpointServiceName *string `min:"20" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdateCustomKeyStoreInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdateCustomKeyStoreInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *UpdateCustomKeyStoreInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "UpdateCustomKeyStoreInput"} if s.CloudHsmClusterId != nil && len(*s.CloudHsmClusterId) < 19 { invalidParams.Add(request.NewErrParamMinLen("CloudHsmClusterId", 19)) } if s.CustomKeyStoreId == nil { invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreId")) } if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) } if s.KeyStorePassword != nil && len(*s.KeyStorePassword) < 7 { invalidParams.Add(request.NewErrParamMinLen("KeyStorePassword", 7)) } if s.NewCustomKeyStoreName != nil && len(*s.NewCustomKeyStoreName) < 1 { invalidParams.Add(request.NewErrParamMinLen("NewCustomKeyStoreName", 1)) } if s.XksProxyUriEndpoint != nil && len(*s.XksProxyUriEndpoint) < 10 { invalidParams.Add(request.NewErrParamMinLen("XksProxyUriEndpoint", 10)) } if s.XksProxyUriPath != nil && len(*s.XksProxyUriPath) < 10 { invalidParams.Add(request.NewErrParamMinLen("XksProxyUriPath", 10)) } if s.XksProxyVpcEndpointServiceName != nil && len(*s.XksProxyVpcEndpointServiceName) < 20 { invalidParams.Add(request.NewErrParamMinLen("XksProxyVpcEndpointServiceName", 20)) } if s.XksProxyAuthenticationCredential != nil { if err := s.XksProxyAuthenticationCredential.Validate(); err != nil { invalidParams.AddNested("XksProxyAuthenticationCredential", err.(request.ErrInvalidParams)) } } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetCloudHsmClusterId sets the CloudHsmClusterId field's value. func (s *UpdateCustomKeyStoreInput) SetCloudHsmClusterId(v string) *UpdateCustomKeyStoreInput { s.CloudHsmClusterId = &v return s } // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. func (s *UpdateCustomKeyStoreInput) SetCustomKeyStoreId(v string) *UpdateCustomKeyStoreInput { s.CustomKeyStoreId = &v return s } // SetKeyStorePassword sets the KeyStorePassword field's value. func (s *UpdateCustomKeyStoreInput) SetKeyStorePassword(v string) *UpdateCustomKeyStoreInput { s.KeyStorePassword = &v return s } // SetNewCustomKeyStoreName sets the NewCustomKeyStoreName field's value. func (s *UpdateCustomKeyStoreInput) SetNewCustomKeyStoreName(v string) *UpdateCustomKeyStoreInput { s.NewCustomKeyStoreName = &v return s } // SetXksProxyAuthenticationCredential sets the XksProxyAuthenticationCredential field's value. func (s *UpdateCustomKeyStoreInput) SetXksProxyAuthenticationCredential(v *XksProxyAuthenticationCredentialType) *UpdateCustomKeyStoreInput { s.XksProxyAuthenticationCredential = v return s } // SetXksProxyConnectivity sets the XksProxyConnectivity field's value. func (s *UpdateCustomKeyStoreInput) SetXksProxyConnectivity(v string) *UpdateCustomKeyStoreInput { s.XksProxyConnectivity = &v return s } // SetXksProxyUriEndpoint sets the XksProxyUriEndpoint field's value. func (s *UpdateCustomKeyStoreInput) SetXksProxyUriEndpoint(v string) *UpdateCustomKeyStoreInput { s.XksProxyUriEndpoint = &v return s } // SetXksProxyUriPath sets the XksProxyUriPath field's value. func (s *UpdateCustomKeyStoreInput) SetXksProxyUriPath(v string) *UpdateCustomKeyStoreInput { s.XksProxyUriPath = &v return s } // SetXksProxyVpcEndpointServiceName sets the XksProxyVpcEndpointServiceName field's value. func (s *UpdateCustomKeyStoreInput) SetXksProxyVpcEndpointServiceName(v string) *UpdateCustomKeyStoreInput { s.XksProxyVpcEndpointServiceName = &v return s } type UpdateCustomKeyStoreOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdateCustomKeyStoreOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdateCustomKeyStoreOutput) GoString() string { return s.String() } type UpdateKeyDescriptionInput struct { _ struct{} `type:"structure"` // New description for the KMS key. // // Do not include confidential or sensitive information in this field. This // field may be displayed in plaintext in CloudTrail logs and other output. // // Description is a required field Description *string `type:"string" required:"true"` // Updates the description of the specified KMS key. // // Specify the key ID or key ARN of the KMS key. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdateKeyDescriptionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdateKeyDescriptionInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *UpdateKeyDescriptionInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "UpdateKeyDescriptionInput"} if s.Description == nil { invalidParams.Add(request.NewErrParamRequired("Description")) } if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetDescription sets the Description field's value. func (s *UpdateKeyDescriptionInput) SetDescription(v string) *UpdateKeyDescriptionInput { s.Description = &v return s } // SetKeyId sets the KeyId field's value. func (s *UpdateKeyDescriptionInput) SetKeyId(v string) *UpdateKeyDescriptionInput { s.KeyId = &v return s } type UpdateKeyDescriptionOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdateKeyDescriptionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdateKeyDescriptionOutput) GoString() string { return s.String() } type UpdatePrimaryRegionInput struct { _ struct{} `type:"structure"` // Identifies the current primary key. When the operation completes, this KMS // key will be a replica key. // // Specify the key ID or key ARN of a multi-Region primary key. // // For example: // // * Key ID: mrk-1234abcd12ab34cd56ef1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // The Amazon Web Services Region of the new primary key. Enter the Region ID, // such as us-east-1 or ap-southeast-2. There must be an existing replica key // in this Region. // // When the operation completes, the multi-Region key in this Region will be // the primary key. // // PrimaryRegion is a required field PrimaryRegion *string `min:"1" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdatePrimaryRegionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdatePrimaryRegionInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *UpdatePrimaryRegionInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "UpdatePrimaryRegionInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.PrimaryRegion == nil { invalidParams.Add(request.NewErrParamRequired("PrimaryRegion")) } if s.PrimaryRegion != nil && len(*s.PrimaryRegion) < 1 { invalidParams.Add(request.NewErrParamMinLen("PrimaryRegion", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetKeyId sets the KeyId field's value. func (s *UpdatePrimaryRegionInput) SetKeyId(v string) *UpdatePrimaryRegionInput { s.KeyId = &v return s } // SetPrimaryRegion sets the PrimaryRegion field's value. func (s *UpdatePrimaryRegionInput) SetPrimaryRegion(v string) *UpdatePrimaryRegionInput { s.PrimaryRegion = &v return s } type UpdatePrimaryRegionOutput struct { _ struct{} `type:"structure"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdatePrimaryRegionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s UpdatePrimaryRegionOutput) GoString() string { return s.String() } type VerifyInput struct { _ struct{} `type:"structure"` // Checks if your request will succeed. DryRun is an optional parameter. // // To learn more about how to use this parameter, see Testing your KMS API calls // (path_to_url // in the Key Management Service Developer Guide. DryRun *bool `type:"boolean"` // A list of grant tokens. // // Use a grant token when your permission to call this operation comes from // a new grant that has not yet achieved eventual consistency. For more information, // see Grant token (path_to_url#grant_token) // and Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // Identifies the asymmetric KMS key that will be used to verify the signature. // This must be the same KMS key that was used to generate the signature. If // you specify a different KMS key, the signature verification fails. // // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. // When using an alias name, prefix it with "alias/". To specify a KMS key in // a different Amazon Web Services account, you must use the key ARN or alias // ARN. // // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // * Alias name: alias/ExampleAlias // // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias // // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. // To get the alias name and alias ARN, use ListAliases. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // Specifies the message that was signed. You can submit a raw message of up // to 4096 bytes, or a hash digest of the message. If you submit a digest, use // the MessageType parameter with a value of DIGEST. // // If the message specified here is different from the message that was signed, // the signature verification fails. A message and its hash digest are considered // to be the same message. // // Message is a sensitive parameter and its value will be // replaced with "sensitive" in string returned by VerifyInput's // String and GoString methods. // // Message is automatically base64 encoded/decoded by the SDK. // // Message is a required field Message []byte `min:"1" type:"blob" required:"true" sensitive:"true"` // Tells KMS whether the value of the Message parameter should be hashed as // part of the signing algorithm. Use RAW for unhashed messages; use DIGEST // for message digests, which are already hashed. // // When the value of MessageType is RAW, KMS uses the standard signing algorithm, // which begins with a hash function. When the value is DIGEST, KMS skips the // hashing step in the signing algorithm. // // Use the DIGEST value only when the value of the Message parameter is a message // digest. If you use the DIGEST value with an unhashed message, the security // of the verification operation can be compromised. // // When the value of MessageTypeis DIGEST, the length of the Message value must // match the length of hashed messages for the specified signing algorithm. // // You can submit a message digest and omit the MessageType or specify RAW so // the digest is hashed again while signing. However, if the signed message // is hashed once while signing, but twice while verifying, verification fails, // even when the message hasn't changed. // // The hashing algorithm in that Verify uses is based on the SigningAlgorithm // value. // // * Signing algorithms that end in SHA_256 use the SHA_256 hashing algorithm. // // * Signing algorithms that end in SHA_384 use the SHA_384 hashing algorithm. // // * Signing algorithms that end in SHA_512 use the SHA_512 hashing algorithm. // // * SM2DSA uses the SM3 hashing algorithm. For details, see Offline verification // with SM2 key pairs (path_to_url#key-spec-sm-offline-verification). MessageType *string `type:"string" enum:"MessageType"` // The signature that the Sign operation generated. // Signature is automatically base64 encoded/decoded by the SDK. // // Signature is a required field Signature []byte `min:"1" type:"blob" required:"true"` // The signing algorithm that was used to sign the message. If you submit a // different algorithm, the signature verification fails. // // SigningAlgorithm is a required field SigningAlgorithm *string `type:"string" required:"true" enum:"SigningAlgorithmSpec"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s VerifyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s VerifyInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *VerifyInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "VerifyInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.Message == nil { invalidParams.Add(request.NewErrParamRequired("Message")) } if s.Message != nil && len(s.Message) < 1 { invalidParams.Add(request.NewErrParamMinLen("Message", 1)) } if s.Signature == nil { invalidParams.Add(request.NewErrParamRequired("Signature")) } if s.Signature != nil && len(s.Signature) < 1 { invalidParams.Add(request.NewErrParamMinLen("Signature", 1)) } if s.SigningAlgorithm == nil { invalidParams.Add(request.NewErrParamRequired("SigningAlgorithm")) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetDryRun sets the DryRun field's value. func (s *VerifyInput) SetDryRun(v bool) *VerifyInput { s.DryRun = &v return s } // SetGrantTokens sets the GrantTokens field's value. func (s *VerifyInput) SetGrantTokens(v []*string) *VerifyInput { s.GrantTokens = v return s } // SetKeyId sets the KeyId field's value. func (s *VerifyInput) SetKeyId(v string) *VerifyInput { s.KeyId = &v return s } // SetMessage sets the Message field's value. func (s *VerifyInput) SetMessage(v []byte) *VerifyInput { s.Message = v return s } // SetMessageType sets the MessageType field's value. func (s *VerifyInput) SetMessageType(v string) *VerifyInput { s.MessageType = &v return s } // SetSignature sets the Signature field's value. func (s *VerifyInput) SetSignature(v []byte) *VerifyInput { s.Signature = v return s } // SetSigningAlgorithm sets the SigningAlgorithm field's value. func (s *VerifyInput) SetSigningAlgorithm(v string) *VerifyInput { s.SigningAlgorithm = &v return s } type VerifyMacInput struct { _ struct{} `type:"structure"` // Checks if your request will succeed. DryRun is an optional parameter. // // To learn more about how to use this parameter, see Testing your KMS API calls // (path_to_url // in the Key Management Service Developer Guide. DryRun *bool `type:"boolean"` // A list of grant tokens. // // Use a grant token when your permission to call this operation comes from // a new grant that has not yet achieved eventual consistency. For more information, // see Grant token (path_to_url#grant_token) // and Using a grant token (path_to_url#using-grant-token) // in the Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // The KMS key that will be used in the verification. // // Enter a key ID of the KMS key that was used to generate the HMAC. If you // identify a different KMS key, the VerifyMac operation fails. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` // The HMAC to verify. Enter the HMAC that was generated by the GenerateMac // operation when you specified the same message, HMAC KMS key, and MAC algorithm // as the values specified in this request. // Mac is automatically base64 encoded/decoded by the SDK. // // Mac is a required field Mac []byte `min:"1" type:"blob" required:"true"` // The MAC algorithm that will be used in the verification. Enter the same MAC // algorithm that was used to compute the HMAC. This algorithm must be supported // by the HMAC KMS key identified by the KeyId parameter. // // MacAlgorithm is a required field MacAlgorithm *string `type:"string" required:"true" enum:"MacAlgorithmSpec"` // The message that will be used in the verification. Enter the same message // that was used to generate the HMAC. // // GenerateMac and VerifyMac do not provide special handling for message digests. // If you generated an HMAC for a hash digest of a message, you must verify // the HMAC for the same hash digest. // // Message is a sensitive parameter and its value will be // replaced with "sensitive" in string returned by VerifyMacInput's // String and GoString methods. // // Message is automatically base64 encoded/decoded by the SDK. // // Message is a required field Message []byte `min:"1" type:"blob" required:"true" sensitive:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s VerifyMacInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s VerifyMacInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *VerifyMacInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "VerifyMacInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.Mac == nil { invalidParams.Add(request.NewErrParamRequired("Mac")) } if s.Mac != nil && len(s.Mac) < 1 { invalidParams.Add(request.NewErrParamMinLen("Mac", 1)) } if s.MacAlgorithm == nil { invalidParams.Add(request.NewErrParamRequired("MacAlgorithm")) } if s.Message == nil { invalidParams.Add(request.NewErrParamRequired("Message")) } if s.Message != nil && len(s.Message) < 1 { invalidParams.Add(request.NewErrParamMinLen("Message", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetDryRun sets the DryRun field's value. func (s *VerifyMacInput) SetDryRun(v bool) *VerifyMacInput { s.DryRun = &v return s } // SetGrantTokens sets the GrantTokens field's value. func (s *VerifyMacInput) SetGrantTokens(v []*string) *VerifyMacInput { s.GrantTokens = v return s } // SetKeyId sets the KeyId field's value. func (s *VerifyMacInput) SetKeyId(v string) *VerifyMacInput { s.KeyId = &v return s } // SetMac sets the Mac field's value. func (s *VerifyMacInput) SetMac(v []byte) *VerifyMacInput { s.Mac = v return s } // SetMacAlgorithm sets the MacAlgorithm field's value. func (s *VerifyMacInput) SetMacAlgorithm(v string) *VerifyMacInput { s.MacAlgorithm = &v return s } // SetMessage sets the Message field's value. func (s *VerifyMacInput) SetMessage(v []byte) *VerifyMacInput { s.Message = v return s } type VerifyMacOutput struct { _ struct{} `type:"structure"` // The HMAC KMS key used in the verification. KeyId *string `min:"1" type:"string"` // The MAC algorithm used in the verification. MacAlgorithm *string `type:"string" enum:"MacAlgorithmSpec"` // A Boolean value that indicates whether the HMAC was verified. A value of // True indicates that the HMAC (Mac) was generated with the specified Message, // HMAC KMS key (KeyID) and MacAlgorithm.. // // If the HMAC is not verified, the VerifyMac operation fails with a KMSInvalidMacException // exception. This exception indicates that one or more of the inputs changed // since the HMAC was computed. MacValid *bool `type:"boolean"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s VerifyMacOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s VerifyMacOutput) GoString() string { return s.String() } // SetKeyId sets the KeyId field's value. func (s *VerifyMacOutput) SetKeyId(v string) *VerifyMacOutput { s.KeyId = &v return s } // SetMacAlgorithm sets the MacAlgorithm field's value. func (s *VerifyMacOutput) SetMacAlgorithm(v string) *VerifyMacOutput { s.MacAlgorithm = &v return s } // SetMacValid sets the MacValid field's value. func (s *VerifyMacOutput) SetMacValid(v bool) *VerifyMacOutput { s.MacValid = &v return s } type VerifyOutput struct { _ struct{} `type:"structure"` // The Amazon Resource Name (key ARN (path_to_url#key-id-key-ARN)) // of the asymmetric KMS key that was used to verify the signature. KeyId *string `min:"1" type:"string"` // A Boolean value that indicates whether the signature was verified. A value // of True indicates that the Signature was produced by signing the Message // with the specified KeyID and SigningAlgorithm. If the signature is not verified, // the Verify operation fails with a KMSInvalidSignatureException exception. SignatureValid *bool `type:"boolean"` // The signing algorithm that was used to verify the signature. SigningAlgorithm *string `type:"string" enum:"SigningAlgorithmSpec"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s VerifyOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s VerifyOutput) GoString() string { return s.String() } // SetKeyId sets the KeyId field's value. func (s *VerifyOutput) SetKeyId(v string) *VerifyOutput { s.KeyId = &v return s } // SetSignatureValid sets the SignatureValid field's value. func (s *VerifyOutput) SetSignatureValid(v bool) *VerifyOutput { s.SignatureValid = &v return s } // SetSigningAlgorithm sets the SigningAlgorithm field's value. func (s *VerifyOutput) SetSigningAlgorithm(v string) *VerifyOutput { s.SigningAlgorithm = &v return s } // The request was rejected because the (XksKeyId) is already associated with // another KMS key in this external key store. Each KMS key in an external key // store must be associated with a different external key. type XksKeyAlreadyInUseException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksKeyAlreadyInUseException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksKeyAlreadyInUseException) GoString() string { return s.String() } func newErrorXksKeyAlreadyInUseException(v protocol.ResponseMetadata) error { return &XksKeyAlreadyInUseException{ RespMetadata: v, } } // Code returns the exception type name. func (s *XksKeyAlreadyInUseException) Code() string { return "XksKeyAlreadyInUseException" } // Message returns the exception's message. func (s *XksKeyAlreadyInUseException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *XksKeyAlreadyInUseException) OrigErr() error { return nil } func (s *XksKeyAlreadyInUseException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *XksKeyAlreadyInUseException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *XksKeyAlreadyInUseException) RequestID() string { return s.RespMetadata.RequestID } // Information about the external key (path_to_url#concept-external-key)that // is associated with a KMS key in an external key store. // // This element appears in a CreateKey or DescribeKey response only for a KMS // key in an external key store. // // The external key is a symmetric encryption key that is hosted by an external // key manager outside of Amazon Web Services. When you use the KMS key in an // external key store in a cryptographic operation, the cryptographic operation // is performed in the external key manager using the specified external key. // For more information, see External key (path_to_url#concept-external-key) // in the Key Management Service Developer Guide. type XksKeyConfigurationType struct { _ struct{} `type:"structure"` // The ID of the external key in its external key manager. This is the ID that // the external key store proxy uses to identify the external key. Id *string `min:"1" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksKeyConfigurationType) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksKeyConfigurationType) GoString() string { return s.String() } // SetId sets the Id field's value. func (s *XksKeyConfigurationType) SetId(v string) *XksKeyConfigurationType { s.Id = &v return s } // The request was rejected because the external key specified by the XksKeyId // parameter did not meet the configuration requirements for an external key // store. // // The external key must be an AES-256 symmetric key that is enabled and performs // encryption and decryption. type XksKeyInvalidConfigurationException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksKeyInvalidConfigurationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksKeyInvalidConfigurationException) GoString() string { return s.String() } func newErrorXksKeyInvalidConfigurationException(v protocol.ResponseMetadata) error { return &XksKeyInvalidConfigurationException{ RespMetadata: v, } } // Code returns the exception type name. func (s *XksKeyInvalidConfigurationException) Code() string { return "XksKeyInvalidConfigurationException" } // Message returns the exception's message. func (s *XksKeyInvalidConfigurationException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *XksKeyInvalidConfigurationException) OrigErr() error { return nil } func (s *XksKeyInvalidConfigurationException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *XksKeyInvalidConfigurationException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *XksKeyInvalidConfigurationException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the external key store proxy could not find // the external key. This exception is thrown when the value of the XksKeyId // parameter doesn't identify a key in the external key manager associated with // the external key proxy. // // Verify that the XksKeyId represents an existing key in the external key manager. // Use the key identifier that the external key store proxy uses to identify // the key. For details, see the documentation provided with your external key // store proxy or key manager. type XksKeyNotFoundException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksKeyNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksKeyNotFoundException) GoString() string { return s.String() } func newErrorXksKeyNotFoundException(v protocol.ResponseMetadata) error { return &XksKeyNotFoundException{ RespMetadata: v, } } // Code returns the exception type name. func (s *XksKeyNotFoundException) Code() string { return "XksKeyNotFoundException" } // Message returns the exception's message. func (s *XksKeyNotFoundException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *XksKeyNotFoundException) OrigErr() error { return nil } func (s *XksKeyNotFoundException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *XksKeyNotFoundException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *XksKeyNotFoundException) RequestID() string { return s.RespMetadata.RequestID } // KMS uses the authentication credential to sign requests that it sends to // the external key store proxy (XKS proxy) on your behalf. You establish these // credentials on your external key store proxy and report them to KMS. // // The XksProxyAuthenticationCredential includes two required elements. type XksProxyAuthenticationCredentialType struct { _ struct{} `type:"structure"` // A unique identifier for the raw secret access key. // // AccessKeyId is a sensitive parameter and its value will be // replaced with "sensitive" in string returned by XksProxyAuthenticationCredentialType's // String and GoString methods. // // AccessKeyId is a required field AccessKeyId *string `min:"20" type:"string" required:"true" sensitive:"true"` // A secret string of 43-64 characters. Valid characters are a-z, A-Z, 0-9, // /, +, and =. // // RawSecretAccessKey is a sensitive parameter and its value will be // replaced with "sensitive" in string returned by XksProxyAuthenticationCredentialType's // String and GoString methods. // // RawSecretAccessKey is a required field RawSecretAccessKey *string `min:"43" type:"string" required:"true" sensitive:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyAuthenticationCredentialType) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyAuthenticationCredentialType) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *XksProxyAuthenticationCredentialType) Validate() error { invalidParams := request.ErrInvalidParams{Context: "XksProxyAuthenticationCredentialType"} if s.AccessKeyId == nil { invalidParams.Add(request.NewErrParamRequired("AccessKeyId")) } if s.AccessKeyId != nil && len(*s.AccessKeyId) < 20 { invalidParams.Add(request.NewErrParamMinLen("AccessKeyId", 20)) } if s.RawSecretAccessKey == nil { invalidParams.Add(request.NewErrParamRequired("RawSecretAccessKey")) } if s.RawSecretAccessKey != nil && len(*s.RawSecretAccessKey) < 43 { invalidParams.Add(request.NewErrParamMinLen("RawSecretAccessKey", 43)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetAccessKeyId sets the AccessKeyId field's value. func (s *XksProxyAuthenticationCredentialType) SetAccessKeyId(v string) *XksProxyAuthenticationCredentialType { s.AccessKeyId = &v return s } // SetRawSecretAccessKey sets the RawSecretAccessKey field's value. func (s *XksProxyAuthenticationCredentialType) SetRawSecretAccessKey(v string) *XksProxyAuthenticationCredentialType { s.RawSecretAccessKey = &v return s } // Detailed information about the external key store proxy (XKS proxy). Your // external key store proxy translates KMS requests into a format that your // external key manager can understand. These fields appear in a DescribeCustomKeyStores // response only when the CustomKeyStoreType is EXTERNAL_KEY_STORE. type XksProxyConfigurationType struct { _ struct{} `type:"structure"` // The part of the external key store proxy authentication credential (path_to_url#your_sha256_hashl) // that uniquely identifies the secret access key. // // AccessKeyId is a sensitive parameter and its value will be // replaced with "sensitive" in string returned by XksProxyConfigurationType's // String and GoString methods. AccessKeyId *string `min:"20" type:"string" sensitive:"true"` // Indicates whether the external key store proxy uses a public endpoint or // an Amazon VPC endpoint service to communicate with KMS. Connectivity *string `type:"string" enum:"XksProxyConnectivityType"` // The URI endpoint for the external key store proxy. // // If the external key store proxy has a public endpoint, it is displayed here. // // If the external key store proxy uses an Amazon VPC endpoint service name, // this field displays the private DNS name associated with the VPC endpoint // service. UriEndpoint *string `min:"10" type:"string"` // The path to the external key store proxy APIs. UriPath *string `min:"10" type:"string"` // The Amazon VPC endpoint service used to communicate with the external key // store proxy. This field appears only when the external key store proxy uses // an Amazon VPC endpoint service to communicate with KMS. VpcEndpointServiceName *string `min:"20" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyConfigurationType) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyConfigurationType) GoString() string { return s.String() } // SetAccessKeyId sets the AccessKeyId field's value. func (s *XksProxyConfigurationType) SetAccessKeyId(v string) *XksProxyConfigurationType { s.AccessKeyId = &v return s } // SetConnectivity sets the Connectivity field's value. func (s *XksProxyConfigurationType) SetConnectivity(v string) *XksProxyConfigurationType { s.Connectivity = &v return s } // SetUriEndpoint sets the UriEndpoint field's value. func (s *XksProxyConfigurationType) SetUriEndpoint(v string) *XksProxyConfigurationType { s.UriEndpoint = &v return s } // SetUriPath sets the UriPath field's value. func (s *XksProxyConfigurationType) SetUriPath(v string) *XksProxyConfigurationType { s.UriPath = &v return s } // SetVpcEndpointServiceName sets the VpcEndpointServiceName field's value. func (s *XksProxyConfigurationType) SetVpcEndpointServiceName(v string) *XksProxyConfigurationType { s.VpcEndpointServiceName = &v return s } // The request was rejected because the proxy credentials failed to authenticate // to the specified external key store proxy. The specified external key store // proxy rejected a status request from KMS due to invalid credentials. This // can indicate an error in the credentials or in the identification of the // external key store proxy. type XksProxyIncorrectAuthenticationCredentialException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyIncorrectAuthenticationCredentialException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyIncorrectAuthenticationCredentialException) GoString() string { return s.String() } func newErrorXksProxyIncorrectAuthenticationCredentialException(v protocol.ResponseMetadata) error { return &XksProxyIncorrectAuthenticationCredentialException{ RespMetadata: v, } } // Code returns the exception type name. func (s *XksProxyIncorrectAuthenticationCredentialException) Code() string { return "XksProxyIncorrectAuthenticationCredentialException" } // Message returns the exception's message. func (s *XksProxyIncorrectAuthenticationCredentialException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *XksProxyIncorrectAuthenticationCredentialException) OrigErr() error { return nil } func (s *XksProxyIncorrectAuthenticationCredentialException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *XksProxyIncorrectAuthenticationCredentialException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *XksProxyIncorrectAuthenticationCredentialException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the external key store proxy is not configured // correctly. To identify the cause, see the error message that accompanies // the exception. type XksProxyInvalidConfigurationException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyInvalidConfigurationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyInvalidConfigurationException) GoString() string { return s.String() } func newErrorXksProxyInvalidConfigurationException(v protocol.ResponseMetadata) error { return &XksProxyInvalidConfigurationException{ RespMetadata: v, } } // Code returns the exception type name. func (s *XksProxyInvalidConfigurationException) Code() string { return "XksProxyInvalidConfigurationException" } // Message returns the exception's message. func (s *XksProxyInvalidConfigurationException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *XksProxyInvalidConfigurationException) OrigErr() error { return nil } func (s *XksProxyInvalidConfigurationException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *XksProxyInvalidConfigurationException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *XksProxyInvalidConfigurationException) RequestID() string { return s.RespMetadata.RequestID } // KMS cannot interpret the response it received from the external key store // proxy. The problem might be a poorly constructed response, but it could also // be a transient network issue. If you see this error repeatedly, report it // to the proxy vendor. type XksProxyInvalidResponseException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyInvalidResponseException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyInvalidResponseException) GoString() string { return s.String() } func newErrorXksProxyInvalidResponseException(v protocol.ResponseMetadata) error { return &XksProxyInvalidResponseException{ RespMetadata: v, } } // Code returns the exception type name. func (s *XksProxyInvalidResponseException) Code() string { return "XksProxyInvalidResponseException" } // Message returns the exception's message. func (s *XksProxyInvalidResponseException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *XksProxyInvalidResponseException) OrigErr() error { return nil } func (s *XksProxyInvalidResponseException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *XksProxyInvalidResponseException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *XksProxyInvalidResponseException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the XksProxyUriEndpoint is already associated // with another external key store in this Amazon Web Services Region. To identify // the cause, see the error message that accompanies the exception. type XksProxyUriEndpointInUseException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyUriEndpointInUseException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyUriEndpointInUseException) GoString() string { return s.String() } func newErrorXksProxyUriEndpointInUseException(v protocol.ResponseMetadata) error { return &XksProxyUriEndpointInUseException{ RespMetadata: v, } } // Code returns the exception type name. func (s *XksProxyUriEndpointInUseException) Code() string { return "XksProxyUriEndpointInUseException" } // Message returns the exception's message. func (s *XksProxyUriEndpointInUseException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *XksProxyUriEndpointInUseException) OrigErr() error { return nil } func (s *XksProxyUriEndpointInUseException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *XksProxyUriEndpointInUseException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *XksProxyUriEndpointInUseException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the concatenation of the XksProxyUriEndpoint // and XksProxyUriPath is already associated with another external key store // in this Amazon Web Services Region. Each external key store in a Region must // use a unique external key store proxy API address. type XksProxyUriInUseException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyUriInUseException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyUriInUseException) GoString() string { return s.String() } func newErrorXksProxyUriInUseException(v protocol.ResponseMetadata) error { return &XksProxyUriInUseException{ RespMetadata: v, } } // Code returns the exception type name. func (s *XksProxyUriInUseException) Code() string { return "XksProxyUriInUseException" } // Message returns the exception's message. func (s *XksProxyUriInUseException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *XksProxyUriInUseException) OrigErr() error { return nil } func (s *XksProxyUriInUseException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *XksProxyUriInUseException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *XksProxyUriInUseException) RequestID() string { return s.RespMetadata.RequestID } // KMS was unable to reach the specified XksProxyUriPath. The path must be reachable // before you create the external key store or update its settings. // // This exception is also thrown when the external key store proxy response // to a GetHealthStatus request indicates that all external key manager instances // are unavailable. type XksProxyUriUnreachableException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyUriUnreachableException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyUriUnreachableException) GoString() string { return s.String() } func newErrorXksProxyUriUnreachableException(v protocol.ResponseMetadata) error { return &XksProxyUriUnreachableException{ RespMetadata: v, } } // Code returns the exception type name. func (s *XksProxyUriUnreachableException) Code() string { return "XksProxyUriUnreachableException" } // Message returns the exception's message. func (s *XksProxyUriUnreachableException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *XksProxyUriUnreachableException) OrigErr() error { return nil } func (s *XksProxyUriUnreachableException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *XksProxyUriUnreachableException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *XksProxyUriUnreachableException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the specified Amazon VPC endpoint service // is already associated with another external key store in this Amazon Web // Services Region. Each external key store in a Region must use a different // Amazon VPC endpoint service. type XksProxyVpcEndpointServiceInUseException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyVpcEndpointServiceInUseException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyVpcEndpointServiceInUseException) GoString() string { return s.String() } func newErrorXksProxyVpcEndpointServiceInUseException(v protocol.ResponseMetadata) error { return &XksProxyVpcEndpointServiceInUseException{ RespMetadata: v, } } // Code returns the exception type name. func (s *XksProxyVpcEndpointServiceInUseException) Code() string { return "XksProxyVpcEndpointServiceInUseException" } // Message returns the exception's message. func (s *XksProxyVpcEndpointServiceInUseException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *XksProxyVpcEndpointServiceInUseException) OrigErr() error { return nil } func (s *XksProxyVpcEndpointServiceInUseException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *XksProxyVpcEndpointServiceInUseException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *XksProxyVpcEndpointServiceInUseException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because the Amazon VPC endpoint service configuration // does not fulfill the requirements for an external key store. To identify // the cause, see the error message that accompanies the exception and review // the requirements (path_to_url#xks-vpc-requirements) // for Amazon VPC endpoint service connectivity for an external key store. type XksProxyVpcEndpointServiceInvalidConfigurationException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyVpcEndpointServiceInvalidConfigurationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyVpcEndpointServiceInvalidConfigurationException) GoString() string { return s.String() } func newErrorXksProxyVpcEndpointServiceInvalidConfigurationException(v protocol.ResponseMetadata) error { return &XksProxyVpcEndpointServiceInvalidConfigurationException{ RespMetadata: v, } } // Code returns the exception type name. func (s *XksProxyVpcEndpointServiceInvalidConfigurationException) Code() string { return "XksProxyVpcEndpointServiceInvalidConfigurationException" } // Message returns the exception's message. func (s *XksProxyVpcEndpointServiceInvalidConfigurationException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *XksProxyVpcEndpointServiceInvalidConfigurationException) OrigErr() error { return nil } func (s *XksProxyVpcEndpointServiceInvalidConfigurationException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *XksProxyVpcEndpointServiceInvalidConfigurationException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *XksProxyVpcEndpointServiceInvalidConfigurationException) RequestID() string { return s.RespMetadata.RequestID } // The request was rejected because KMS could not find the specified VPC endpoint // service. Use DescribeCustomKeyStores to verify the VPC endpoint service name // for the external key store. Also, confirm that the Allow principals list // for the VPC endpoint service includes the KMS service principal for the Region, // such as cks.kms.us-east-1.amazonaws.com. type XksProxyVpcEndpointServiceNotFoundException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyVpcEndpointServiceNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s XksProxyVpcEndpointServiceNotFoundException) GoString() string { return s.String() } func newErrorXksProxyVpcEndpointServiceNotFoundException(v protocol.ResponseMetadata) error { return &XksProxyVpcEndpointServiceNotFoundException{ RespMetadata: v, } } // Code returns the exception type name. func (s *XksProxyVpcEndpointServiceNotFoundException) Code() string { return "XksProxyVpcEndpointServiceNotFoundException" } // Message returns the exception's message. func (s *XksProxyVpcEndpointServiceNotFoundException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *XksProxyVpcEndpointServiceNotFoundException) OrigErr() error { return nil } func (s *XksProxyVpcEndpointServiceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *XksProxyVpcEndpointServiceNotFoundException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *XksProxyVpcEndpointServiceNotFoundException) RequestID() string { return s.RespMetadata.RequestID } const ( // AlgorithmSpecRsaesPkcs1V15 is a AlgorithmSpec enum value AlgorithmSpecRsaesPkcs1V15 = "RSAES_PKCS1_V1_5" // AlgorithmSpecRsaesOaepSha1 is a AlgorithmSpec enum value AlgorithmSpecRsaesOaepSha1 = "RSAES_OAEP_SHA_1" // AlgorithmSpecRsaesOaepSha256 is a AlgorithmSpec enum value AlgorithmSpecRsaesOaepSha256 = "RSAES_OAEP_SHA_256" // AlgorithmSpecRsaAesKeyWrapSha1 is a AlgorithmSpec enum value AlgorithmSpecRsaAesKeyWrapSha1 = "RSA_AES_KEY_WRAP_SHA_1" // AlgorithmSpecRsaAesKeyWrapSha256 is a AlgorithmSpec enum value AlgorithmSpecRsaAesKeyWrapSha256 = "RSA_AES_KEY_WRAP_SHA_256" ) // AlgorithmSpec_Values returns all elements of the AlgorithmSpec enum func AlgorithmSpec_Values() []string { return []string{ AlgorithmSpecRsaesPkcs1V15, AlgorithmSpecRsaesOaepSha1, AlgorithmSpecRsaesOaepSha256, AlgorithmSpecRsaAesKeyWrapSha1, AlgorithmSpecRsaAesKeyWrapSha256, } } const ( // ConnectionErrorCodeTypeInvalidCredentials is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeInvalidCredentials = "INVALID_CREDENTIALS" // ConnectionErrorCodeTypeClusterNotFound is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeClusterNotFound = "CLUSTER_NOT_FOUND" // ConnectionErrorCodeTypeNetworkErrors is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeNetworkErrors = "NETWORK_ERRORS" // ConnectionErrorCodeTypeInternalError is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeInternalError = "INTERNAL_ERROR" // ConnectionErrorCodeTypeInsufficientCloudhsmHsms is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeInsufficientCloudhsmHsms = "INSUFFICIENT_CLOUDHSM_HSMS" // ConnectionErrorCodeTypeUserLockedOut is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeUserLockedOut = "USER_LOCKED_OUT" // ConnectionErrorCodeTypeUserNotFound is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeUserNotFound = "USER_NOT_FOUND" // ConnectionErrorCodeTypeUserLoggedIn is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeUserLoggedIn = "USER_LOGGED_IN" // ConnectionErrorCodeTypeSubnetNotFound is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeSubnetNotFound = "SUBNET_NOT_FOUND" // ConnectionErrorCodeTypeInsufficientFreeAddressesInSubnet is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeInsufficientFreeAddressesInSubnet = "INSUFFICIENT_FREE_ADDRESSES_IN_SUBNET" // ConnectionErrorCodeTypeXksProxyAccessDenied is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeXksProxyAccessDenied = "XKS_PROXY_ACCESS_DENIED" // ConnectionErrorCodeTypeXksProxyNotReachable is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeXksProxyNotReachable = "XKS_PROXY_NOT_REACHABLE" // ConnectionErrorCodeTypeXksVpcEndpointServiceNotFound is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeXksVpcEndpointServiceNotFound = "XKS_VPC_ENDPOINT_SERVICE_NOT_FOUND" // ConnectionErrorCodeTypeXksProxyInvalidResponse is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeXksProxyInvalidResponse = "XKS_PROXY_INVALID_RESPONSE" // ConnectionErrorCodeTypeXksProxyInvalidConfiguration is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeXksProxyInvalidConfiguration = "XKS_PROXY_INVALID_CONFIGURATION" // your_sha256_hash is a ConnectionErrorCodeType enum value your_sha256_hash = "XKS_VPC_ENDPOINT_SERVICE_INVALID_CONFIGURATION" // ConnectionErrorCodeTypeXksProxyTimedOut is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeXksProxyTimedOut = "XKS_PROXY_TIMED_OUT" // ConnectionErrorCodeTypeXksProxyInvalidTlsConfiguration is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeXksProxyInvalidTlsConfiguration = "XKS_PROXY_INVALID_TLS_CONFIGURATION" ) // ConnectionErrorCodeType_Values returns all elements of the ConnectionErrorCodeType enum func ConnectionErrorCodeType_Values() []string { return []string{ ConnectionErrorCodeTypeInvalidCredentials, ConnectionErrorCodeTypeClusterNotFound, ConnectionErrorCodeTypeNetworkErrors, ConnectionErrorCodeTypeInternalError, ConnectionErrorCodeTypeInsufficientCloudhsmHsms, ConnectionErrorCodeTypeUserLockedOut, ConnectionErrorCodeTypeUserNotFound, ConnectionErrorCodeTypeUserLoggedIn, ConnectionErrorCodeTypeSubnetNotFound, ConnectionErrorCodeTypeInsufficientFreeAddressesInSubnet, ConnectionErrorCodeTypeXksProxyAccessDenied, ConnectionErrorCodeTypeXksProxyNotReachable, ConnectionErrorCodeTypeXksVpcEndpointServiceNotFound, ConnectionErrorCodeTypeXksProxyInvalidResponse, ConnectionErrorCodeTypeXksProxyInvalidConfiguration, your_sha256_hash, ConnectionErrorCodeTypeXksProxyTimedOut, ConnectionErrorCodeTypeXksProxyInvalidTlsConfiguration, } } const ( // ConnectionStateTypeConnected is a ConnectionStateType enum value ConnectionStateTypeConnected = "CONNECTED" // ConnectionStateTypeConnecting is a ConnectionStateType enum value ConnectionStateTypeConnecting = "CONNECTING" // ConnectionStateTypeFailed is a ConnectionStateType enum value ConnectionStateTypeFailed = "FAILED" // ConnectionStateTypeDisconnected is a ConnectionStateType enum value ConnectionStateTypeDisconnected = "DISCONNECTED" // ConnectionStateTypeDisconnecting is a ConnectionStateType enum value ConnectionStateTypeDisconnecting = "DISCONNECTING" ) // ConnectionStateType_Values returns all elements of the ConnectionStateType enum func ConnectionStateType_Values() []string { return []string{ ConnectionStateTypeConnected, ConnectionStateTypeConnecting, ConnectionStateTypeFailed, ConnectionStateTypeDisconnected, ConnectionStateTypeDisconnecting, } } const ( // CustomKeyStoreTypeAwsCloudhsm is a CustomKeyStoreType enum value CustomKeyStoreTypeAwsCloudhsm = "AWS_CLOUDHSM" // CustomKeyStoreTypeExternalKeyStore is a CustomKeyStoreType enum value CustomKeyStoreTypeExternalKeyStore = "EXTERNAL_KEY_STORE" ) // CustomKeyStoreType_Values returns all elements of the CustomKeyStoreType enum func CustomKeyStoreType_Values() []string { return []string{ CustomKeyStoreTypeAwsCloudhsm, CustomKeyStoreTypeExternalKeyStore, } } const ( // CustomerMasterKeySpecRsa2048 is a CustomerMasterKeySpec enum value CustomerMasterKeySpecRsa2048 = "RSA_2048" // CustomerMasterKeySpecRsa3072 is a CustomerMasterKeySpec enum value CustomerMasterKeySpecRsa3072 = "RSA_3072" // CustomerMasterKeySpecRsa4096 is a CustomerMasterKeySpec enum value CustomerMasterKeySpecRsa4096 = "RSA_4096" // CustomerMasterKeySpecEccNistP256 is a CustomerMasterKeySpec enum value CustomerMasterKeySpecEccNistP256 = "ECC_NIST_P256" // CustomerMasterKeySpecEccNistP384 is a CustomerMasterKeySpec enum value CustomerMasterKeySpecEccNistP384 = "ECC_NIST_P384" // CustomerMasterKeySpecEccNistP521 is a CustomerMasterKeySpec enum value CustomerMasterKeySpecEccNistP521 = "ECC_NIST_P521" // CustomerMasterKeySpecEccSecgP256k1 is a CustomerMasterKeySpec enum value CustomerMasterKeySpecEccSecgP256k1 = "ECC_SECG_P256K1" // CustomerMasterKeySpecSymmetricDefault is a CustomerMasterKeySpec enum value CustomerMasterKeySpecSymmetricDefault = "SYMMETRIC_DEFAULT" // CustomerMasterKeySpecHmac224 is a CustomerMasterKeySpec enum value CustomerMasterKeySpecHmac224 = "HMAC_224" // CustomerMasterKeySpecHmac256 is a CustomerMasterKeySpec enum value CustomerMasterKeySpecHmac256 = "HMAC_256" // CustomerMasterKeySpecHmac384 is a CustomerMasterKeySpec enum value CustomerMasterKeySpecHmac384 = "HMAC_384" // CustomerMasterKeySpecHmac512 is a CustomerMasterKeySpec enum value CustomerMasterKeySpecHmac512 = "HMAC_512" // CustomerMasterKeySpecSm2 is a CustomerMasterKeySpec enum value CustomerMasterKeySpecSm2 = "SM2" ) // CustomerMasterKeySpec_Values returns all elements of the CustomerMasterKeySpec enum func CustomerMasterKeySpec_Values() []string { return []string{ CustomerMasterKeySpecRsa2048, CustomerMasterKeySpecRsa3072, CustomerMasterKeySpecRsa4096, CustomerMasterKeySpecEccNistP256, CustomerMasterKeySpecEccNistP384, CustomerMasterKeySpecEccNistP521, CustomerMasterKeySpecEccSecgP256k1, CustomerMasterKeySpecSymmetricDefault, CustomerMasterKeySpecHmac224, CustomerMasterKeySpecHmac256, CustomerMasterKeySpecHmac384, CustomerMasterKeySpecHmac512, CustomerMasterKeySpecSm2, } } const ( // DataKeyPairSpecRsa2048 is a DataKeyPairSpec enum value DataKeyPairSpecRsa2048 = "RSA_2048" // DataKeyPairSpecRsa3072 is a DataKeyPairSpec enum value DataKeyPairSpecRsa3072 = "RSA_3072" // DataKeyPairSpecRsa4096 is a DataKeyPairSpec enum value DataKeyPairSpecRsa4096 = "RSA_4096" // DataKeyPairSpecEccNistP256 is a DataKeyPairSpec enum value DataKeyPairSpecEccNistP256 = "ECC_NIST_P256" // DataKeyPairSpecEccNistP384 is a DataKeyPairSpec enum value DataKeyPairSpecEccNistP384 = "ECC_NIST_P384" // DataKeyPairSpecEccNistP521 is a DataKeyPairSpec enum value DataKeyPairSpecEccNistP521 = "ECC_NIST_P521" // DataKeyPairSpecEccSecgP256k1 is a DataKeyPairSpec enum value DataKeyPairSpecEccSecgP256k1 = "ECC_SECG_P256K1" // DataKeyPairSpecSm2 is a DataKeyPairSpec enum value DataKeyPairSpecSm2 = "SM2" ) // DataKeyPairSpec_Values returns all elements of the DataKeyPairSpec enum func DataKeyPairSpec_Values() []string { return []string{ DataKeyPairSpecRsa2048, DataKeyPairSpecRsa3072, DataKeyPairSpecRsa4096, DataKeyPairSpecEccNistP256, DataKeyPairSpecEccNistP384, DataKeyPairSpecEccNistP521, DataKeyPairSpecEccSecgP256k1, DataKeyPairSpecSm2, } } const ( // DataKeySpecAes256 is a DataKeySpec enum value DataKeySpecAes256 = "AES_256" // DataKeySpecAes128 is a DataKeySpec enum value DataKeySpecAes128 = "AES_128" ) // DataKeySpec_Values returns all elements of the DataKeySpec enum func DataKeySpec_Values() []string { return []string{ DataKeySpecAes256, DataKeySpecAes128, } } const ( // EncryptionAlgorithmSpecSymmetricDefault is a EncryptionAlgorithmSpec enum value EncryptionAlgorithmSpecSymmetricDefault = "SYMMETRIC_DEFAULT" // EncryptionAlgorithmSpecRsaesOaepSha1 is a EncryptionAlgorithmSpec enum value EncryptionAlgorithmSpecRsaesOaepSha1 = "RSAES_OAEP_SHA_1" // EncryptionAlgorithmSpecRsaesOaepSha256 is a EncryptionAlgorithmSpec enum value EncryptionAlgorithmSpecRsaesOaepSha256 = "RSAES_OAEP_SHA_256" // EncryptionAlgorithmSpecSm2pke is a EncryptionAlgorithmSpec enum value EncryptionAlgorithmSpecSm2pke = "SM2PKE" ) // EncryptionAlgorithmSpec_Values returns all elements of the EncryptionAlgorithmSpec enum func EncryptionAlgorithmSpec_Values() []string { return []string{ EncryptionAlgorithmSpecSymmetricDefault, EncryptionAlgorithmSpecRsaesOaepSha1, EncryptionAlgorithmSpecRsaesOaepSha256, EncryptionAlgorithmSpecSm2pke, } } const ( // ExpirationModelTypeKeyMaterialExpires is a ExpirationModelType enum value ExpirationModelTypeKeyMaterialExpires = "KEY_MATERIAL_EXPIRES" // ExpirationModelTypeKeyMaterialDoesNotExpire is a ExpirationModelType enum value ExpirationModelTypeKeyMaterialDoesNotExpire = "KEY_MATERIAL_DOES_NOT_EXPIRE" ) // ExpirationModelType_Values returns all elements of the ExpirationModelType enum func ExpirationModelType_Values() []string { return []string{ ExpirationModelTypeKeyMaterialExpires, ExpirationModelTypeKeyMaterialDoesNotExpire, } } const ( // GrantOperationDecrypt is a GrantOperation enum value GrantOperationDecrypt = "Decrypt" // GrantOperationEncrypt is a GrantOperation enum value GrantOperationEncrypt = "Encrypt" // GrantOperationGenerateDataKey is a GrantOperation enum value GrantOperationGenerateDataKey = "GenerateDataKey" // GrantOperationGenerateDataKeyWithoutPlaintext is a GrantOperation enum value GrantOperationGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext" // GrantOperationReEncryptFrom is a GrantOperation enum value GrantOperationReEncryptFrom = "ReEncryptFrom" // GrantOperationReEncryptTo is a GrantOperation enum value GrantOperationReEncryptTo = "ReEncryptTo" // GrantOperationSign is a GrantOperation enum value GrantOperationSign = "Sign" // GrantOperationVerify is a GrantOperation enum value GrantOperationVerify = "Verify" // GrantOperationGetPublicKey is a GrantOperation enum value GrantOperationGetPublicKey = "GetPublicKey" // GrantOperationCreateGrant is a GrantOperation enum value GrantOperationCreateGrant = "CreateGrant" // GrantOperationRetireGrant is a GrantOperation enum value GrantOperationRetireGrant = "RetireGrant" // GrantOperationDescribeKey is a GrantOperation enum value GrantOperationDescribeKey = "DescribeKey" // GrantOperationGenerateDataKeyPair is a GrantOperation enum value GrantOperationGenerateDataKeyPair = "GenerateDataKeyPair" // GrantOperationGenerateDataKeyPairWithoutPlaintext is a GrantOperation enum value GrantOperationGenerateDataKeyPairWithoutPlaintext = "GenerateDataKeyPairWithoutPlaintext" // GrantOperationGenerateMac is a GrantOperation enum value GrantOperationGenerateMac = "GenerateMac" // GrantOperationVerifyMac is a GrantOperation enum value GrantOperationVerifyMac = "VerifyMac" ) // GrantOperation_Values returns all elements of the GrantOperation enum func GrantOperation_Values() []string { return []string{ GrantOperationDecrypt, GrantOperationEncrypt, GrantOperationGenerateDataKey, GrantOperationGenerateDataKeyWithoutPlaintext, GrantOperationReEncryptFrom, GrantOperationReEncryptTo, GrantOperationSign, GrantOperationVerify, GrantOperationGetPublicKey, GrantOperationCreateGrant, GrantOperationRetireGrant, GrantOperationDescribeKey, GrantOperationGenerateDataKeyPair, GrantOperationGenerateDataKeyPairWithoutPlaintext, GrantOperationGenerateMac, GrantOperationVerifyMac, } } const ( // KeyEncryptionMechanismRsaesOaepSha256 is a KeyEncryptionMechanism enum value KeyEncryptionMechanismRsaesOaepSha256 = "RSAES_OAEP_SHA_256" ) // KeyEncryptionMechanism_Values returns all elements of the KeyEncryptionMechanism enum func KeyEncryptionMechanism_Values() []string { return []string{ KeyEncryptionMechanismRsaesOaepSha256, } } const ( // KeyManagerTypeAws is a KeyManagerType enum value KeyManagerTypeAws = "AWS" // KeyManagerTypeCustomer is a KeyManagerType enum value KeyManagerTypeCustomer = "CUSTOMER" ) // KeyManagerType_Values returns all elements of the KeyManagerType enum func KeyManagerType_Values() []string { return []string{ KeyManagerTypeAws, KeyManagerTypeCustomer, } } const ( // KeySpecRsa2048 is a KeySpec enum value KeySpecRsa2048 = "RSA_2048" // KeySpecRsa3072 is a KeySpec enum value KeySpecRsa3072 = "RSA_3072" // KeySpecRsa4096 is a KeySpec enum value KeySpecRsa4096 = "RSA_4096" // KeySpecEccNistP256 is a KeySpec enum value KeySpecEccNistP256 = "ECC_NIST_P256" // KeySpecEccNistP384 is a KeySpec enum value KeySpecEccNistP384 = "ECC_NIST_P384" // KeySpecEccNistP521 is a KeySpec enum value KeySpecEccNistP521 = "ECC_NIST_P521" // KeySpecEccSecgP256k1 is a KeySpec enum value KeySpecEccSecgP256k1 = "ECC_SECG_P256K1" // KeySpecSymmetricDefault is a KeySpec enum value KeySpecSymmetricDefault = "SYMMETRIC_DEFAULT" // KeySpecHmac224 is a KeySpec enum value KeySpecHmac224 = "HMAC_224" // KeySpecHmac256 is a KeySpec enum value KeySpecHmac256 = "HMAC_256" // KeySpecHmac384 is a KeySpec enum value KeySpecHmac384 = "HMAC_384" // KeySpecHmac512 is a KeySpec enum value KeySpecHmac512 = "HMAC_512" // KeySpecSm2 is a KeySpec enum value KeySpecSm2 = "SM2" ) // KeySpec_Values returns all elements of the KeySpec enum func KeySpec_Values() []string { return []string{ KeySpecRsa2048, KeySpecRsa3072, KeySpecRsa4096, KeySpecEccNistP256, KeySpecEccNistP384, KeySpecEccNistP521, KeySpecEccSecgP256k1, KeySpecSymmetricDefault, KeySpecHmac224, KeySpecHmac256, KeySpecHmac384, KeySpecHmac512, KeySpecSm2, } } const ( // KeyStateCreating is a KeyState enum value KeyStateCreating = "Creating" // KeyStateEnabled is a KeyState enum value KeyStateEnabled = "Enabled" // KeyStateDisabled is a KeyState enum value KeyStateDisabled = "Disabled" // KeyStatePendingDeletion is a KeyState enum value KeyStatePendingDeletion = "PendingDeletion" // KeyStatePendingImport is a KeyState enum value KeyStatePendingImport = "PendingImport" // KeyStatePendingReplicaDeletion is a KeyState enum value KeyStatePendingReplicaDeletion = "PendingReplicaDeletion" // KeyStateUnavailable is a KeyState enum value KeyStateUnavailable = "Unavailable" // KeyStateUpdating is a KeyState enum value KeyStateUpdating = "Updating" ) // KeyState_Values returns all elements of the KeyState enum func KeyState_Values() []string { return []string{ KeyStateCreating, KeyStateEnabled, KeyStateDisabled, KeyStatePendingDeletion, KeyStatePendingImport, KeyStatePendingReplicaDeletion, KeyStateUnavailable, KeyStateUpdating, } } const ( // KeyUsageTypeSignVerify is a KeyUsageType enum value KeyUsageTypeSignVerify = "SIGN_VERIFY" // KeyUsageTypeEncryptDecrypt is a KeyUsageType enum value KeyUsageTypeEncryptDecrypt = "ENCRYPT_DECRYPT" // KeyUsageTypeGenerateVerifyMac is a KeyUsageType enum value KeyUsageTypeGenerateVerifyMac = "GENERATE_VERIFY_MAC" ) // KeyUsageType_Values returns all elements of the KeyUsageType enum func KeyUsageType_Values() []string { return []string{ KeyUsageTypeSignVerify, KeyUsageTypeEncryptDecrypt, KeyUsageTypeGenerateVerifyMac, } } const ( // MacAlgorithmSpecHmacSha224 is a MacAlgorithmSpec enum value MacAlgorithmSpecHmacSha224 = "HMAC_SHA_224" // MacAlgorithmSpecHmacSha256 is a MacAlgorithmSpec enum value MacAlgorithmSpecHmacSha256 = "HMAC_SHA_256" // MacAlgorithmSpecHmacSha384 is a MacAlgorithmSpec enum value MacAlgorithmSpecHmacSha384 = "HMAC_SHA_384" // MacAlgorithmSpecHmacSha512 is a MacAlgorithmSpec enum value MacAlgorithmSpecHmacSha512 = "HMAC_SHA_512" ) // MacAlgorithmSpec_Values returns all elements of the MacAlgorithmSpec enum func MacAlgorithmSpec_Values() []string { return []string{ MacAlgorithmSpecHmacSha224, MacAlgorithmSpecHmacSha256, MacAlgorithmSpecHmacSha384, MacAlgorithmSpecHmacSha512, } } const ( // MessageTypeRaw is a MessageType enum value MessageTypeRaw = "RAW" // MessageTypeDigest is a MessageType enum value MessageTypeDigest = "DIGEST" ) // MessageType_Values returns all elements of the MessageType enum func MessageType_Values() []string { return []string{ MessageTypeRaw, MessageTypeDigest, } } const ( // MultiRegionKeyTypePrimary is a MultiRegionKeyType enum value MultiRegionKeyTypePrimary = "PRIMARY" // MultiRegionKeyTypeReplica is a MultiRegionKeyType enum value MultiRegionKeyTypeReplica = "REPLICA" ) // MultiRegionKeyType_Values returns all elements of the MultiRegionKeyType enum func MultiRegionKeyType_Values() []string { return []string{ MultiRegionKeyTypePrimary, MultiRegionKeyTypeReplica, } } const ( // OriginTypeAwsKms is a OriginType enum value OriginTypeAwsKms = "AWS_KMS" // OriginTypeExternal is a OriginType enum value OriginTypeExternal = "EXTERNAL" // OriginTypeAwsCloudhsm is a OriginType enum value OriginTypeAwsCloudhsm = "AWS_CLOUDHSM" // OriginTypeExternalKeyStore is a OriginType enum value OriginTypeExternalKeyStore = "EXTERNAL_KEY_STORE" ) // OriginType_Values returns all elements of the OriginType enum func OriginType_Values() []string { return []string{ OriginTypeAwsKms, OriginTypeExternal, OriginTypeAwsCloudhsm, OriginTypeExternalKeyStore, } } const ( // SigningAlgorithmSpecRsassaPssSha256 is a SigningAlgorithmSpec enum value SigningAlgorithmSpecRsassaPssSha256 = "RSASSA_PSS_SHA_256" // SigningAlgorithmSpecRsassaPssSha384 is a SigningAlgorithmSpec enum value SigningAlgorithmSpecRsassaPssSha384 = "RSASSA_PSS_SHA_384" // SigningAlgorithmSpecRsassaPssSha512 is a SigningAlgorithmSpec enum value SigningAlgorithmSpecRsassaPssSha512 = "RSASSA_PSS_SHA_512" // SigningAlgorithmSpecRsassaPkcs1V15Sha256 is a SigningAlgorithmSpec enum value SigningAlgorithmSpecRsassaPkcs1V15Sha256 = "RSASSA_PKCS1_V1_5_SHA_256" // SigningAlgorithmSpecRsassaPkcs1V15Sha384 is a SigningAlgorithmSpec enum value SigningAlgorithmSpecRsassaPkcs1V15Sha384 = "RSASSA_PKCS1_V1_5_SHA_384" // SigningAlgorithmSpecRsassaPkcs1V15Sha512 is a SigningAlgorithmSpec enum value SigningAlgorithmSpecRsassaPkcs1V15Sha512 = "RSASSA_PKCS1_V1_5_SHA_512" // SigningAlgorithmSpecEcdsaSha256 is a SigningAlgorithmSpec enum value SigningAlgorithmSpecEcdsaSha256 = "ECDSA_SHA_256" // SigningAlgorithmSpecEcdsaSha384 is a SigningAlgorithmSpec enum value SigningAlgorithmSpecEcdsaSha384 = "ECDSA_SHA_384" // SigningAlgorithmSpecEcdsaSha512 is a SigningAlgorithmSpec enum value SigningAlgorithmSpecEcdsaSha512 = "ECDSA_SHA_512" // SigningAlgorithmSpecSm2dsa is a SigningAlgorithmSpec enum value SigningAlgorithmSpecSm2dsa = "SM2DSA" ) // SigningAlgorithmSpec_Values returns all elements of the SigningAlgorithmSpec enum func SigningAlgorithmSpec_Values() []string { return []string{ SigningAlgorithmSpecRsassaPssSha256, SigningAlgorithmSpecRsassaPssSha384, SigningAlgorithmSpecRsassaPssSha512, SigningAlgorithmSpecRsassaPkcs1V15Sha256, SigningAlgorithmSpecRsassaPkcs1V15Sha384, SigningAlgorithmSpecRsassaPkcs1V15Sha512, SigningAlgorithmSpecEcdsaSha256, SigningAlgorithmSpecEcdsaSha384, SigningAlgorithmSpecEcdsaSha512, SigningAlgorithmSpecSm2dsa, } } const ( // WrappingKeySpecRsa2048 is a WrappingKeySpec enum value WrappingKeySpecRsa2048 = "RSA_2048" // WrappingKeySpecRsa3072 is a WrappingKeySpec enum value WrappingKeySpecRsa3072 = "RSA_3072" // WrappingKeySpecRsa4096 is a WrappingKeySpec enum value WrappingKeySpecRsa4096 = "RSA_4096" ) // WrappingKeySpec_Values returns all elements of the WrappingKeySpec enum func WrappingKeySpec_Values() []string { return []string{ WrappingKeySpecRsa2048, WrappingKeySpecRsa3072, WrappingKeySpecRsa4096, } } const ( // XksProxyConnectivityTypePublicEndpoint is a XksProxyConnectivityType enum value XksProxyConnectivityTypePublicEndpoint = "PUBLIC_ENDPOINT" // XksProxyConnectivityTypeVpcEndpointService is a XksProxyConnectivityType enum value XksProxyConnectivityTypeVpcEndpointService = "VPC_ENDPOINT_SERVICE" ) // XksProxyConnectivityType_Values returns all elements of the XksProxyConnectivityType enum func XksProxyConnectivityType_Values() []string { return []string{ XksProxyConnectivityTypePublicEndpoint, XksProxyConnectivityTypeVpcEndpointService, } } ```
The 2023–24 Appalachian State Mountaineers men's basketball team will represent Appalachian State University in the 2023–24 NCAA Division I men's basketball season. The Mountaineers, will be led by fifth-year head coach Dustin Kerns, and play their home games at the Holmes Center in Boone, North Carolina as members in the Sun Belt Conference. Previous season The Mountaineers finished the 2022–23 season 16–16, 9–9 in Sun Belt play to finish in a tie for seventh place. The Mountaineers lost to South Alabama in the first round of the Sun Belt tournament. Offseason Departures Incoming transfers 2023 recruiting class Preseason Preseason Sun Belt Conference poll The Mountaineers were picked to finish in second place in the conference's preseason poll. Graduate forward Donovan Gregory was named to the preseason All-SBC First Team. Senior forward CJ Huntley was named to the conference preseason third team. Roster Schedule and results |- !colspan=12 style=| Non-conference regular season |- !colspan=9 style=| Sun Belt Conference regular season |- !colspan=9 style=| Sun Belt tournament Source References Appalachian State Mountaineers men's basketball seasons Appalachian State Mountaineers Appalachian State Mountaineers men's basketball Appalachian State Mountaineers men's basketball
Selimcan Temel (born 27 May 2000) is a Turkish professional footballer who plays as a defensive midfielder for Karacabey Belediyespor on loan from the Süper Lig club Hatayspor. Career Temel began his senior career with İnegölspor in the TFF First League, playing with them 78 times in the league. He transferred to the Süper Lig club Hatayspor on 19 January 2022. He made his professional debut with Hatayspor in a 2–0 Süper Lig loss to Fenerbahçe on 20 February 2022. References External links 2000 births Living people Footballers from Bursa Turkish men's footballers Men's association football midfielders İnegölspor footballers Hatayspor footballers Fethiyespor footballers Karacabey Belediyespor footballers Süper Lig players TFF Second League players
Jeanne-Marie Busuttil (born 29 June 1976) is a former professional golfer from France who was a member of the LPGA Tour in the early 2000s. Amateur career Busuttil was born in Paris, France and moved to America where she attended the University of Florida and Arizona State University, playing on teams for both schools. Busuttil won the French Junior Championship in 1991 and became a member of the French National team from 1993 to 1997. While at Arizona State University, she won two collegiate tournaments: the 1996 NCAA East Regional and the 1995 South Carolina Invitational. She was a three-time NCAA All-American and was a member of the 1997-98 NCAA Championship team at Arizona State. Professional career Busuttil turned professional in August 1998 after lettering at Arizona State from 1996 to 1998. In 2001, she finished second at the LPGA Final Qualifying Tournament to earn exempt status for the 2002 season. She competed on the Futures Tour, where she won one tournament and finished fifth on the money list. She was also a member of the Ladies European Tour. Professional wins (1) Futures Tour wins (1) 2001 M&T Bank Loretto FUTURES Golf Classic Team appearances Amateur European Ladies' Team Championship (representing France): 1997 See also List of Florida Gators women's golfers on the LPGA Tour References External links Jeanne-Marie Busuttil on Yahoo! Sports Florida Players Honor Roll Florida Players on the LPGA French female golfers Florida Gators women's golfers Arizona State Sun Devils women's golfers LPGA Tour golfers Ladies European Tour golfers Golfers from Paris 1976 births Living people
```java * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ package org.flowable.eventregistry.model; import com.fasterxml.jackson.databind.JsonNode; public class ChannelModel { protected String key; protected String category; protected String name; protected String description; // inbound or outbound protected String channelType; // jms, rabbitmq, kafka etc protected String type; protected JsonNode extension; public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getChannelType() { return channelType; } public void setChannelType(String channelType) { this.channelType = channelType; } public String getType() { return type; } public void setType(String type) { this.type = type; } public JsonNode getExtension() { return extension; } public void setExtension(JsonNode extension) { this.extension = extension; } } ```
Tsend (, genitive form: Tsendiin, ) is a Mongolian name, signifying: Tsendiin Damdinsüren (1908–1986), Mongolian author Luvsansharavyn Tsend (born 1940), Mongolian Olympic speed-skater Tsendiin Nyamdorj (born 1956), chairman of the Mongolian parliament Tsendiin Damdin (1957–2018), olympic judo silver medalist of 1957 Tsend-Ayuushiin Ochirbat (born 1974), Mongolian Olympic judoka Tsendiin Mönkh-Orgil, the foreign minister of Mongolia
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>append.js - Documentation</title> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="path_to_url"> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <input type="checkbox" id="nav-trigger" class="nav-trigger" /> <label for="nav-trigger" class="navicon-button x"> <div class="navicon"></div> </label> <label for="nav-trigger" class="overlay"></label> <nav> <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-append.html">append</a></li><li><a href="module-appendArray.html">appendArray</a></li><li><a href="module-at.html">at</a></li><li><a href="module-base64decode.html">base64decode</a></li><li><a href="module-base64encode.html">base64encode</a></li><li><a href="module-between.html">between</a></li><li><a href="module-binDecode.html">binDecode</a></li><li><a href="module-binEncode.html">binEncode</a></li><li><a href="module-chars.html">chars</a></li><li><a href="module-collapseWhitespace.html">collapseWhitespace</a></li><li><a href="module-compare.html">compare</a></li><li><a href="module-contains.html">contains</a></li><li><a href="module-containsAll.html">containsAll</a></li><li><a href="module-containsAny.html">containsAny</a></li><li><a href="module-countSubstr.html">countSubstr</a></li><li><a href="module-decDecode.html">decDecode</a></li><li><a href="module-decEncode.html">decEncode</a></li><li><a href="module-endsWith.html">endsWith</a></li><li><a href="module-ensureLeft.html">ensureLeft</a></li><li><a href="module-ensureRight.html">ensureRight</a></li><li><a href="module-equal.html">equal</a></li><li><a href="module-first.html">first</a></li><li><a href="module-format.html">format</a></li><li><a href="module-hexDecode.html">hexDecode</a></li><li><a href="module-hexEncode.html">hexEncode</a></li><li><a href="module-htmlDecode.html">htmlDecode</a></li><li><a href="module-htmlEncode.html">htmlEncode</a></li><li><a href="module-inequal.html">inequal</a></li><li><a href="module-insert.html">insert</a></li><li><a href="module-isLowerCase.html">isLowerCase</a></li><li><a href="module-isString.html">isString</a></li><li><a href="module-isUpperCase.html">isUpperCase</a></li><li><a href="module-last.html">last</a></li><li><a href="module-lastIndefOf.html">lastIndefOf</a></li><li><a href="module-leftPad.html">leftPad</a></li><li><a href="module-leftTrim.html">leftTrim</a></li><li><a href="module-prepend.html">prepend</a></li><li><a href="module-prependArray.html">prependArray</a></li><li><a href="module-removeEmptyStrings.html">removeEmptyStrings</a></li><li><a href="module-removeLeft.html">removeLeft</a></li><li><a href="module-removeNonWords.html">removeNonWords</a></li><li><a href="module-removeSpaces.html">removeSpaces</a></li><li><a href="module-repeat.html">repeat</a></li><li><a href="module-replace.html">replace</a></li><li><a href="module-reverse.html">reverse</a></li><li><a href="module-rightPad.html">rightPad</a></li><li><a href="module-rightTrim.html">rightTrim</a></li><li><a href="module-safeTruncate.html">safeTruncate</a></li><li><a href="module-shuffle.html">shuffle</a></li><li><a href="module-slugify.html">slugify</a></li><li><a href="module-split.html">split</a></li><li><a href="module-startsWith.html">startsWith</a></li><li><a href="module-substr.html">substr</a></li><li><a href="module-surround.html">surround</a></li><li><a href="module-toCamelCase.html">toCamelCase</a></li><li><a href="module-toDecamelize.html">toDecamelize</a></li><li><a href="module-toKebabCase.html">toKebabCase</a></li><li><a href="module-toLowerCase.html">toLowerCase</a></li><li><a href="module-toSnakeCase.html">toSnakeCase</a></li><li><a href="module-toStudlyCaps.html">toStudlyCaps</a></li><li><a href="module-toUpperCase.html">toUpperCase</a></li><li><a href="module-transliterate.html">transliterate</a></li><li><a href="module-trim.html">trim</a></li><li><a href="module-truncate.html">truncate</a></li><li><a href="module-urlDecode.html">urlDecode</a></li><li><a href="module-urlEncode.html">urlEncode</a></li></ul> </nav> <div id="main"> <h1 class="page-title">append.js</h1> <section> <article> <pre class="prettyprint source linenums"><code>import appendArray from './appendarray' /** * @module append * @description * Append Strings on Value with spreaded arguments * ## Install * Install all functions of strman * ```sh * yarn add strman * ``` * or just the append function * ```sh * yarn add strman.append * ``` * ## Usage * ```javascript * import { append } from 'strman' * // OR * import append from 'strman.append' * ``` * @param {String} value Initial value * @param {String} appends Spreaded array with strings to append * @example * append('s', 'tr', 'm', 'an') * // => 'strman' * @returns {String} The concatenated string */ export default (value, ...appends) => appendArray(value, appends) </code></pre> </article> </section> </div> <br class="clear"> <footer> Documentation generated by <a href="path_to_url">JSDoc 3.4.3</a> on Sun Mar 26 2017 19:48:28 GMT-0300 (BRT) using the Minami theme. </footer> <script>prettyPrint();</script> <script src="scripts/linenumber.js"></script> </body> </html> ```
Pantera Capital is an American hedge fund that specializes in cryptocurrencies. It is the largest crypto hedge fund in the world by AUM. The firm was founded in 2003 by Dan Morehead (ex Tiger Management) and is co-managed by Co-CIO Joey Krug, the founder of the first major Ethereum project, Augur. In 2013, it launched the first investment fund focused on Bitcoin in the United States. See also Economics of bitcoin Alternative investment Cryptocurrency References Hedge funds Hedge fund firms of the United States Companies based in Menlo Park, California American companies established in 2003 Tiger Management
Luis Alberto Riart was the Paraguayan Minister of Education and Culture under President Fernando Lugo. References Living people Government ministers of Paraguay Year of birth missing (living people) Place of birth missing (living people)
Chinese reforms or Chinese reform may refer to a number of events from Chinese history: Hundred Days' Reform, failed Qing dynasty reforms in the 1898 Chinese economic reform, a variety of economic reforms in China beginning in the late-1970s Thought reform in China, Chinese campaign focused on the acceptance of Marxism–Leninism in the 1950s Healthcare reform in China, reforms to the Chinese healthcare system 2020–2021 Xi Jinping Administration reform spree, ongoing reforms to the economy and culture of China by the Chinese Communist Party
The Kṣitigarbha Bodhisattva Pūrvapraṇidhāna Sūtra (Sanskrit, Sutra of the Fundamental Vows of the Bodhisattva Kṣitigarbha; ) or Kṣitigarbhasūtra is a Mahāyāna sūtra teaching about the bodhisattva Kṣitigarbha and is one of the more popular sūtras in Chinese Buddhism. The sutra tells of how Kṣitigarbha became a bodhisattva by making great vows to rescue other sentient beings and a description of how he displayed filial piety in his past lifetimes. The sutra also expounds at length the retributions of unwholesome karma, descriptions of Buddhist hells and the benefits of good merit both great and small. History The Kṣitigarbhasūtra was first translated from Sanskrit into Chinese in the 7th century during the Tang dynasty by the Tripiṭaka master Śikṣānanda, a monk from Khotan who also provided a new translation of the Avataṃsaka Sūtra and the Laṅkāvatāra Sūtra. Some scholars suspected that instead of being translated, this text may have originated in China since no Sanskrit manuscripts of this text have been found. Part of the reason for suspicion is that the text advocates filial piety, which is commonly associated with Confucianism in Chinese culture. Since then, other scholars such as Gregory Schopen have countered that Indian Buddhism also had traditions of filial piety. One example is the Buddha's sharing of the dharma in the form of Abhidhamma with his late mother who was reborn as a celestial being in the abode of Tavatimsa, which was the greatest gift that he could offer out of filial piety to his late mother. Currently, there is no clear evidence indicating either an Indian or Chinese origin for the text. Contents There are a total of thirteen chapters in the Kṣitigarbhasūtra, which are divided into three sections. The teaching is presented in the form of a dialogue between the Buddha and Kṣitigarbha and takes place in the Trāyastriṃśa Heaven, located on the top of Mount Meru, in front of a vast multitude of sentient beings. It includes tales of Kṣitigarbha's skill at freeing beings from the hells and instructions on dealing with the dying and the dead. This sutra has multiple aspects for buddhists who are in various condition. For example, A dharma to 'leave the sea of suffering and realize the happiness of Nirvana' and finally 'Ultimate attainment of Buddhahood'. A teaching concerning karmic retribution, graphically describing the consequences one creates for oneself by committing undesirable actions. filial piety – not only that between oneself and one's parents, but also in an ultimate sense of a universal code of duty or responsibility for all living beings. For example, the Buddha frequently mentions the benefits of dedicating any good merit done to all sentient beings: "Moreover, if they should be able to dedicate rewards thus gained for the benefit of the entire Dharmadhatu, then their bliss will defy comparison." In the last Chapter 13, Buddha also spoke about 28 kinds of benefits for "any good man or good woman who should see Ksitigarbha's image and hear this Sutra and, furthermore, read and recite it, and who should also donate incense, flowers, drink, food, clothing and precious treasures as offerings, in addition to giving praise and making obeisance to Bodhisattva Ksitigarbha" Those 28 benefits of reciting Kṣitigarbhasūtra are as follows: 一者、天龍護念 They will be protected by heavenly beings and dragons. 二者、善果日增 They will increase in good mind day after day. 三者、集聖上因 They will accumulate superior wisdom. 四者、菩提不退 They will never regress from Bodhi. 五者、衣食豐足 They will be opulent in food and clothing. 六者、疾疫不臨 They will never suffer from any disease. 七者、離水火災 They will be far away from flood, fire and disaster. 八者、無盜賊厄 They will not be stolen from or robbed. 九者、人見欽敬 They will be respected by everyone. 十者、神鬼助持 Gods and ghosts will help and support them. 十一者、女轉男身 A woman may be reborn as a male in the next life. 十二者、為王臣女 A woman may be born as a king’s or minister’s daughter. 十三者、端正相好 They will be born with good-looking features. 十四者、多生天上 They will be reincarnated in heaven. 十五者、或為帝王 They may be reincarnated as a king. 十六者、宿智命通 They will be aware of their former lives. 十七者、有求皆從 They will obtain anything they ask. 十八者、眷屬歡樂 Their families and relatives will be joyful. 十九者、諸橫消滅 All disasters or accidents will be eliminated. 二十者、業道永除 They will be rid of all bad karma. 二十一者、去處盡通 They will go anywhere without problems. 二十二者、夜夢安樂 They will have pleasant and peaceful dreams. 二十三者、先亡離苦 Their deceased relatives will be far away from suffering. 二十四者、宿福受生 They will receive the blessings from their past lives. 二十五者、諸聖讚歎 They will be praised by Buddhas and Bodhisattvas. 二十六者、聰明利根 They will become intelligent and have a good roots. 二十七者、饒慈愍心 They will possess a merciful heart. 二十八者、畢竟成佛 They will ultimately realize Buddhahood. References Mahayana sutras Kṣitigarbha
```vue <script> import fecha from 'element-ui/src/utils/date'; import { range as rangeArr, getFirstDayOfMonth, getPrevMonthLastDays, getMonthDays, getI18nSettings, validateRangeInOneMonth } from 'element-ui/src/utils/date-util'; export default { props: { selectedDay: String, // formated date yyyy-MM-dd range: { type: Array, validator(val) { if (!(val && val.length)) return true; const [start, end] = val; return validateRangeInOneMonth(start, end); } }, date: Date, hideHeader: Boolean, firstDayOfWeek: Number }, inject: ['elCalendar'], methods: { toNestedArr(days) { return rangeArr(days.length / 7).map((_, index) => { const start = index * 7; return days.slice(start, start + 7); }); }, getFormateDate(day, type) { if (!day || ['prev', 'current', 'next'].indexOf(type) === -1) { throw new Error('invalid day or type'); } let prefix = this.curMonthDatePrefix; if (type === 'prev') { prefix = this.prevMonthDatePrefix; } else if (type === 'next') { prefix = this.nextMonthDatePrefix; } day = `00${day}`.slice(-2); return `${prefix}-${day}`; }, getCellClass({ text, type}) { const classes = [type]; if (type === 'current') { const date = this.getFormateDate(text, type); if (date === this.selectedDay) { classes.push('is-selected'); } if (date === this.formatedToday) { classes.push('is-today'); } } return classes; }, pickDay({ text, type }) { const date = this.getFormateDate(text, type); this.$emit('pick', date); }, cellRenderProxy({ text, type }) { let render = this.elCalendar.$scopedSlots.dateCell; if (!render) return <span>{ text }</span>; const day = this.getFormateDate(text, type); const date = new Date(day); const data = { isSelected: this.selectedDay === day, type: `${type}-month`, day }; return render({ date, data }); } }, computed: { WEEK_DAYS() { return getI18nSettings().dayNames; }, prevMonthDatePrefix() { const temp = new Date(this.date.getTime()); temp.setDate(0); return fecha.format(temp, 'yyyy-MM'); }, curMonthDatePrefix() { return fecha.format(this.date, 'yyyy-MM'); }, nextMonthDatePrefix() { const temp = new Date(this.date.getFullYear(), this.date.getMonth() + 1, 1); return fecha.format(temp, 'yyyy-MM'); }, formatedToday() { return this.elCalendar.formatedToday; }, isInRange() { return this.range && this.range.length; }, rows() { let days = []; // if range exists, should render days in range. if (this.isInRange) { const [start, end] = this.range; const currentMonthRange = rangeArr(end.getDate() - start.getDate() + 1).map((_, index) => ({ text: start.getDate() + index, type: 'current' })); let remaining = currentMonthRange.length % 7; remaining = remaining === 0 ? 0 : 7 - remaining; const nextMonthRange = rangeArr(remaining).map((_, index) => ({ text: index + 1, type: 'next' })); days = currentMonthRange.concat(nextMonthRange); } else { const date = this.date; let firstDay = getFirstDayOfMonth(date); firstDay = firstDay === 0 ? 7 : firstDay; const firstDayOfWeek = typeof this.firstDayOfWeek === 'number' ? this.firstDayOfWeek : 1; const offset = (7 + firstDay - firstDayOfWeek) % 7; const prevMonthDays = getPrevMonthLastDays(date, offset).map(day => ({ text: day, type: 'prev' })); const currentMonthDays = getMonthDays(date).map(day => ({ text: day, type: 'current' })); days = [...prevMonthDays, ...currentMonthDays]; const nextMonthDays = rangeArr(42 - days.length).map((_, index) => ({ text: index + 1, type: 'next' })); days = days.concat(nextMonthDays); } return this.toNestedArr(days); }, weekDays() { const start = this.firstDayOfWeek; const { WEEK_DAYS } = this; if (typeof start !== 'number' || start === 0) { return WEEK_DAYS.slice(); } else { return WEEK_DAYS.slice(start).concat(WEEK_DAYS.slice(0, start)); } } }, render() { const thead = this.hideHeader ? null : (<thead> { this.weekDays.map(day => <th key={day}>{ day }</th>) } </thead>); return ( <table class={{ 'el-calendar-table': true, 'is-range': this.isInRange }} cellspacing="0" cellpadding="0"> { thead } <tbody> { this.rows.map((row, index) => <tr class={{ 'el-calendar-table__row': true, 'el-calendar-table__row--hide-border': index === 0 && this.hideHeader }} key={index}> { row.map((cell, key) => <td key={key} class={ this.getCellClass(cell) } onClick={this.pickDay.bind(this, cell)}> <div class="el-calendar-day"> { this.cellRenderProxy(cell) } </div> </td>) } </tr>) } </tbody> </table>); } }; </script> ```
Liefde waakt is a 1914 Dutch silent Western film directed by Louis H. Chrispijn. Cast Annie Bos as Jennie Willem van der Veer Christine van Meeteren Jan van Dommelen as Painter Jan Holtrop as Gang leader, Jennie's father Mientje Kling as Extra Alex Benno as Policeman Emile Timrott Marius Spree External links 1914 films 1914 Western (genre) films Dutch Western (genre) films Dutch black-and-white films Dutch silent short films Films directed by Louis H. Chrispijn Silent Western (genre) films
National Route 12 or N12 is one of the main national roads of Morocco. It runs from Sidi Ifni on the Atlantic coast through Guelmim, Assa, Akka, Tata, and Foum Zguid to Zagora, passing Alnife National Park along its course , all the way to The city of Rissani , at the tafilalte oases , Most of the road is good. There is very little traffic , highly used by bikers and off-road vehicles , longing the east of Morocco unplugged , along the anti Atlas Mountains , then west to the Atlantic coast , the city of sidi ifni . Roads in Morocco
```javascript Props in getInitialState Is an Anti-Pattern componentWillReceiveProps Not Triggered After Mounting Keyed fragments in **React** Prop Validation Validate for required props ```
```xml import type { ElementStyles } from '@microsoft/fast-element'; import { css } from '@microsoft/fast-element'; import { borderRadiusMedium, colorNeutralBackground3, colorNeutralForeground3, colorNeutralStroke1, colorPaletteDarkOrangeBackground1, colorPaletteDarkOrangeBorder1, colorPaletteGreenBackground1, colorPaletteGreenBorder1, colorPaletteRedBackground1, colorPaletteRedBorder1, fontFamilyBase, fontSizeBase200, lineHeightBase200, spacingHorizontalM, spacingHorizontalS, spacingVerticalMNudge, spacingVerticalS, } from '../theme/design-tokens.js'; import { errorState, multiLineState, squareState, successState, warningState } from '../styles/states/index.js'; /** * Styles for the MessageBar component. * * @public */ export const styles: ElementStyles = css` :host { display: grid; box-sizing: border-box; font-family: ${fontFamilyBase}; font-size: ${fontSizeBase200}; line-height: ${lineHeightBase200}; width: 100%; background: ${colorNeutralBackground3}; border: 1px solid ${colorNeutralStroke1}; padding-inline: ${spacingHorizontalM}; border-radius: ${borderRadiusMedium}; min-height: 36px; align-items: center; grid-template: 'icon body actions dismiss' / auto 1fr auto auto; contain: layout style paint; } :host(${squareState}) { border-radius: 0; } :host(${successState}) { background-color: ${colorPaletteGreenBackground1}; border-color: ${colorPaletteGreenBorder1}; } :host(${warningState}) { background-color: ${colorPaletteDarkOrangeBackground1}; border-color: ${colorPaletteDarkOrangeBorder1}; } :host(${errorState}) { background-color: ${colorPaletteRedBackground1}; border-color: ${colorPaletteRedBorder1}; } :host(${multiLineState}) { grid-template-areas: 'icon body dismiss' 'actions actions actions'; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto 1fr; padding-block: ${spacingVerticalMNudge}; padding-inline: ${spacingHorizontalM}; } .content { grid-area: body; max-width: 520px; padding-block: ${spacingVerticalMNudge}; padding-inline: 0; } :host(${multiLineState}) .content { padding: 0; } ::slotted([slot='icon']) { display: flex; grid-area: icon; flex-direction: column; align-items: center; color: ${colorNeutralForeground3}; margin-inline-end: ${spacingHorizontalS}; } :host(${multiLineState}) ::slotted([slot='icon']) { align-items: start; height: 100%; } ::slotted([slot='dismiss']) { grid-area: dismiss; } .actions { grid-area: actions; display: flex; justify-self: end; margin-inline-end: ${spacingHorizontalS}; gap: ${spacingHorizontalS}; } :host(${multiLineState}) .actions { margin-block-start: ${spacingVerticalMNudge}; margin-inline-end: 0; } :host(${multiLineState}) ::slotted([slot='dismiss']) { align-items: start; height: 100%; padding-block-start: ${spacingVerticalS}; } ::slotted(*) { font-size: inherit; } `; ```
Fernando Ortiz Arana (born October 26, 1944, in Santiago de Querétaro) is a Mexican politician and long serving legislator affiliated with the Institutional Revolutionary Party (PRI). Ortiz Arana is the son of José Ortiz Antañana, a real estate agent, and Virginia Arana Morán. He graduated from the Autonomous University of Queretaro in 1967 with a bachelor's degree in law. He joined the Institutional Revolutionary Party in 1963 and chaired it in the late 1990s. He has also served three terms as a federal congressman, as the President of the Chamber of Deputies in 1991, one term as a senator and has run unsuccessfully for governor in 1997 and in 2003. References Source: Diccionario biográfico del gobierno mexicano, Ed. Fondo de Cultura Económica, Mexico, 1992. 1944 births Living people Members of the Senate of the Republic (Mexico) Members of the Chamber of Deputies (Mexico) Presidents of the Chamber of Deputies (Mexico) Presidents of the Senate of the Republic (Mexico) Mexican people of Basque descent Autonomous University of Queretaro alumni Presidents of the Institutional Revolutionary Party Politicians from Querétaro 21st-century Mexican politicians People from Querétaro City 20th-century Mexican politicians
Abshurak (, also Romanized as Ābshūrak and Āb Shūrk; also known as Ābsūreh) is a village in Isin Rural District, in the Central District of Bandar Abbas County, Hormozgan Province, Iran. At the 2006 census, its population was 2,056, in 451 families. References Populated places in Bandar Abbas County
Roland Günther (born 11 December 1962) is a German cyclist. He won the bronze medal in the team pursuit along with Rolf Gölz, Reinhard Alber and Michael Marx in the 1984 Summer Olympics. References 1962 births Living people German male cyclists Cyclists at the 1984 Summer Olympics Olympic cyclists for West Germany West German male cyclists Olympic bronze medalists for West Germany People from Bergstraße (district) Sportspeople from Darmstadt (region) Cyclists from Hesse Medalists at the 1984 Summer Olympics Olympic medalists in cycling
Kapenguria Constituency is an electoral constituency in Kenya. It is one of four constituencies of West Pokot County. The constituency was established for the 1988 elections. Members of Parliament Locations and wards References Constituencies in West Pokot County Constituencies in Rift Valley Province 1988 establishments in Kenya Constituencies established in 1988
Black Lick Township is a township in Indiana County, Pennsylvania, United States. The population was 1,133 at the 2020 census. The township includes the communities of Grafton, Jacksonville, and Newport. Geography According to the United States Census Bureau, the township has a total area of , of which is land and (1.79%) is water. Demographics As of the census of 2000, there were 1,317 people, 515 households, and 388 families residing in the township. The population density was . There were 540 housing units at an average density of 19.7/sq mi (7.6/km2). The racial makeup of the township was 99.32% White, 0.08% from other races, and 0.61% from two or more races. Hispanic or Latino of any race were 0.23% of the population. There were 515 households, out of which 30.1% had children under the age of 18 living with them, 65.0% were married couples living together, 6.4% had a female householder with no husband present, and 24.5% were non-families. 21.9% of all households were made up of individuals, and 10.5% had someone living alone who was 65 years of age or older. The average household size was 2.55 and the average family size was 2.97. In the township the population was spread out, with 23.5% under the age of 18, 6.5% from 18 to 24, 29.2% from 25 to 44, 26.1% from 45 to 64, and 14.7% who were 65 years of age or older. The median age was 40 years. For every 100 females, there were 96.6 males. For every 100 females age 18 and over, there were 94.2 males. The median income for a household in the township was $35,536, and the median income for a family was $42,500. Males had a median income of $35,625 versus $21,016 for females. The per capita income for the township was $16,766. About 7.8% of families and 10.0% of the population were below the poverty line, including 13.3% of those under age 18 and 8.3% of those age 65 or over. References Townships in Indiana County, Pennsylvania Townships in Pennsylvania
```c /*** *_tolower.c - convert character to lower case * * *Purpose: * Defines _Tolower(). * *******************************************************************************/ #include <internal_shared.h> #include <ctype.h> #include <stddef.h> #include <xlocinfo.h> #include <locale.h> #include <awint.h> #include <stdlib.h> #include <yvals.h> /* remove macro definitions of _tolower() and tolower() */ #undef _tolower #undef tolower /*** *int _Tolower(c) - convert character to lower case * *Purpose: * _Tolower() is a version of tolower with a locale argument. * *Entry: * c - int value of character to be converted * const _Ctypevec * = pointer to locale info * *Exit: * returns int value of lower case representation of c * *Exceptions: * *******************************************************************************/ _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Tolower ( int c, const _Ctypevec *ploc ) { int size; unsigned char inbuffer[3]; unsigned char outbuffer[3]; UINT codepage; LCID _Locale; //const wchar_t *locale_name; if (ploc == 0) { //locale_name = ___lc_locale_name_func()[LC_CTYPE]; _Locale = ___lc_handle_func()[LC_CTYPE]; codepage = ___lc_codepage_func(); } else { //locale_name = ploc->_LocaleName; _Locale = __acrt_LocaleNameToLCID(ploc->_LocaleName, 0); codepage = ploc->_Page; } //if (locale_name == NULL) if(_Locale==0) { if ( (c >= 'A') && (c <= 'Z') ) c = c + ('a' - 'A'); return c; } /* if checking case of c does not require API call, do it */ if ((unsigned)c < 256) { if (ploc == 0) { if (!isupper(c)) { return c; } } else { if (!(ploc->_Table[c] & _UPPER)) { return c; } } } /* convert int c to multibyte string */ if (ploc == 0 ? _cpp_isleadbyte((c >> 8) & 0xff) : (ploc->_Table[(c >> 8) & 0xff] & _LEADBYTE) != 0) { inbuffer[0] = (c >> 8 & 0xff); inbuffer[1] = (unsigned char)c; inbuffer[2] = 0; size = 2; } else { inbuffer[0] = (unsigned char)c; inbuffer[1] = 0; size = 1; } /* convert wide char to lowercase */ if (0 == (size = __crtLCMapStringA(_Locale, LCMAP_LOWERCASE, (const char *)inbuffer, size, (char *)outbuffer, 3, codepage, TRUE))) { return c; } /* construct integer return value */ if (size == 1) return ((int)outbuffer[0]); else return ((int)outbuffer[1] | ((int)outbuffer[0] << 8)); } /*** *_Ctypevec _Getctype() - get ctype info for current locale * *Purpose: * *Entry: * *Exit: * *Exceptions: * *******************************************************************************/ _CRTIMP2_PURE _Ctypevec __CLRCALL_PURE_OR_CDECL _Getctype() { /* get ctype info for current locale */ _Ctypevec ctype; ctype._Page = ___lc_codepage_func(); ctype._Table = (const short *)_calloc_crt(256, sizeof (*__pctype_func())); if (ctype._Table != 0) { memcpy((void *)ctype._Table, __pctype_func(), 256 * sizeof (*__pctype_func())); ctype._Delfl = 1; } else { ctype._Table = (const short *)__pctype_func(); ctype._Delfl = 0; } wchar_t _LocaleName[LOCALE_NAME_MAX_LENGTH]; //ctype._LocaleName = ___lc_locale_name_func()[LC_COLLATE]; auto __lc_collate = ___lc_handle_func()[LC_COLLATE]; if (__lc_collate&&__acrt_LCIDToLocaleName(__lc_collate, _LocaleName, _countof(_LocaleName), 0)) ctype._LocaleName = _wcsdup_dbg(_LocaleName, _CRT_BLOCK, __FILE__, __LINE__); else ctype._LocaleName = NULL; return (ctype); } ```
Open the Door may refer to: Open the Door (Roger Hodgson album), 2000 "Open the Door", the album's title track Open the Door (Pentangle album), 1985 "Open the Door", the album's title track "Open the Door" (Betty Carter song) "Open the Door" (Magnapop song) "Open the Door", a song by Die Antwoord "Open the Door", a song by Bad Gyal and Govana featuring DJ Papis "Open the Door", a song by James Booker "Open the Door", a song by Im Chang-jung "Open the Door", a song by Sugababes from Change "Open the Door", a song by Zion I and The Grouch from Heroes in the City of Dope "Open the Door (To Your Heart)", a song by Van Morrison from Born to Sing: No Plan B "Song for Judith (Open the Door)", a song by Judy Collins See also Open the Door - Live at Mietta's, a 1992 collaborative live jazz album by Jex Saarelaht and Kate Ceberano "Open the Door, Richard", a 1954 song first recorded by Jack McVea Open the door see mountain, a Chinglish expression "Let My Love Open the Door", a 1980 Pete Townshend song The Open Door, an album by the American rock band Evanescence
The Elephant Hotel is a historic former hotel which today serves as the town hall in Somers, in Westchester County, New York, United States. It was listed on the National Register of Historic Places (NRHP) on August 7, 1974 as Somers Town House and designated a National Historic Landmark in 2005 as Elephant Hotel. It is also a contributing property in the NRHP-listed Somers Hamlet Historic District. It is located at 335 US 202, across from the northern end of NY 100. History Hachaliah Bailey (known as the creator of Bailey Circus) built the Elephant Hotel in Somers, NY, after buying an African elephant, which he named "Old Bet". Bailey intended to use the elephant for farm work, but the number of people it attracted caused Bailey to tour her throughout the northeast. Old Bet was killed on tour in 1816, when she was shot by a local farmer. Bailey's tours were the first of their type in the nation, and inspired numerous others to tour with exotic animals, and during the 1830s the old style circus and Bailey's attractions merged to form the modern circus. Due to this, Somers is known as the "Cradle of the American Circus". Bailey had purchased this land in 1805, and began construction of the hotel in 1821, as a memorial to the animals he displayed. It is said Old Bet was buried in front of the building. The monument to Old Bet that stands in front of the hotel was placed in 1827. In 1835, the hotel was incorporated by the Zoological Institute. The Elephant Hotel was purchased by the town of Somers in 1927. It is a town landmark and was dedicated a National Historic Landmark in 2005. Museum of the Early American Circus The Somers Historical Society occupies the third floor of the building. The Society operates the Museum of the Early American Circus, which is open on Thursday afternoons and for special holidays. Popular culture Monumental Mysteries featured an episode about Old Bet in 2013 Japanese singer-songwriter Akiko Yano released an album titled Elephant Hotel in 1994; the cover features a photograph of Yano standing in front of the hotel. See also List of National Historic Landmarks in New York National Register of Historic Places listings in northern Westchester County, New York References External links Elephant Hotel history - Somers Historical Society Museum of the Early American Circus - Somers Historical Society Individually listed contributing properties to historic districts on the National Register in New York (state) City and town halls in New York (state) Hotels in New York (state) National Historic Landmarks in New York (state) National Register of Historic Places in Westchester County, New York Hotel buildings completed in 1825 Buildings and structures in Westchester County, New York Museums in Westchester County, New York Circus museums in the United States Historical society museums in New York (state) Historic American Buildings Survey in New York (state) Somers, New York New York State Register of Historic Places in Westchester County
Stephanie Ho (Chinese; 何雁詩, born 2 November 1992) is a Hong Kong singer, actress and golfer. Early life Stephanie Ho was born in San Jose, California and grew up in Hong Kong with her parents. Her father is a businessman. Since a young age, she has been playing golf and has represented Hong Kong in many tournaments. Her parents wanted her to be a professional golfer but she chose to be a singer instead. She studied at Heep Yunn School and Sha Tin College but was home-schooled in her last year due to her busy schedule of maintaining singing and studying. When she was 14, she started learning music at Baron School of Music, and completed multiple singing courses as well as being largely featured in a concept album. After completing her A-Levels she decided to study hotel and tourism management at Hong Kong Polytechnic University. In her last year of university, she suspended her studies as she had been majorly cast in Gilded Chopsticks. Besides playing golf, she also learnt how to play wood ball and represented her university in competitions and won awards. Golf Stephanie started playing golf when she was 6, and entered many tournaments. At the age of 10, she joined the Hong Kong National Golf Team, and later became a Hong Kong Ladies Champion Golfer, but stopped playing when she was 18. In 2009, she was the record winner of the Hong Kong Ladies Close Amateur Championship. In the 2010 Asian Games, she ranked 26th out of 30 in the individual event and 8th out of 10 in the team event. She also played on the Hong Kong team at the Espirito Santos Trophy (World Amateur Championships) in 2010. Due to her parents' influence, Ho learned to play golf at a young age. Although she did not continue professionally playing after entering the entertainment industry, she occasionally practises golf with friends. Since 2011, she was a professional golfer, but in December 2017, she officially changed from a professional golfer back to an amateur golfer to give herself more chances to participate in local competitions. She consequently announced she would be participating in an amateur golf competition. On 3–5 January 2018, she competed and won the Hong Kong Ladies Close Amateur Championship for the second time after winning it in 2009, and played her first golf competition since 2010. She was later invited to play in the 2018 Hong Kong Ladies Open alongside childhood best friend and LPGA player Tiffany Chan. After making her comeback in golf, she also returned to her position as a Hong Kong National Golf Ladies' Squad Team representative. Personal life Friendship When filming Raising The Bar, Ho became best friends with Jeannie Chan and Moon Lau. She also shared an apartment with Jeannie Chan for a year (2015-2016). She is also close with others in the entertainment industry including Winki Lai, Sisley Choi, Anjaylia Chan, Cheronna Ng, Fred Cheung, Joey Law, Dickson Yu, Mayao Ma, Grace Chan, Adrian Chau, Daniel Chau and William Chak. In the music industry, she is good friends with Hubert Wu, Kayee Tam, James Ng, Sophy Wong, Alfred Hui and Jason Chan. In 2020, Ho, along with Winki Lai, Sisley Choi, Jeannie Chan, Anjaylia Chan and Cheronna Ng named their friendship group 'SÏXTERS'. Relationship On 21 September 2015, Ho went public with her relationship with Korean-Japanese boyfriend, Wataru Yu. In mid-late 2016, she admitted their breakup. On 6 April 2017, Ho admitted her relationship with fellow singer, Fred Cheng. On 1 January 2020, Ho and Cheng announced their engagement along with pre-wedding photos on Instagram, and revealed Cheng had proposed while they were on holiday in Thailand. The couple married on 7 November 2020 and held their wedding at Hyatt Regency Sha Tin, Hong Kong. On 13 January 2022, Ho announced on Instagram that she is pregnant. Their son, Asher Douglas Cheng, was born on 1 June 2022. Depression On 31 March 2017, Ho posted on Instagram that she would be resigning from upcoming drama My Ages Apart due to private illness. Days later, she admitted on Instagram that she had been suffering from emotional illness as she received tremendous pressure from the public regarding her private life and health. While being interviewed at an event on 31 December 2017, she said that she had recovered from depression but was still taking medication. Music Career Beginnings/Debut: 2009–2014 When Ho was 16, she entered Hong Kong's The Voice in 2009 as a contestant, which started off her singing career. Although she didn't win, she gained fame and support from the public and also received an award for being in the Top 5 viral songs sung on the show. In 2013, she signed with MusicNext and released her first single "淚如鐵". In 2014, she officially debuted as a singer and achieved multiple best new artist awards. She released her first album, STEP, on 28 November 2014. Voice Entertainment/Rise in Popularity: 2016–2019 The following year, Ho ended her contract with MusicNext and signed with Voice Entertainment. She officially joined on 24 March 2015 but did not release her first single with the company until 2016 due to her busy schedule of filming dramas. After releasing "最真心一對" (True Lovers), she received positive feedback and continued to sing many drama theme songs. In November, she starred in the drama Dead Wrong as well as singing the ending theme song, "愛需要勇氣" (Love Takes Courage), which topped multiple charts and rose to popularity. In the 2016 TVB Anniversary Awards, "愛需要勇氣" reached Top 3 out of 38 nominations for the award of Favourite TVB Drama Theme Song. In the JSG Awards Presentation 2016 she received a gold song award for "愛需要勇氣" and an outstanding performance award. On 24 January 2017, she released her second album, Lost In Love, which reached No.1 Album in Asian Pop at HMV. It also came in 1st runner-up in the KKBOX Top Albums of 2017. In March, she sang a duet with Fred Cheng, "真心真意" (With All My Heart), as the theme song for Married but Available. In May, she sang "我不會撒嬌" (I Would Not Pout) as the opening theme song for My Unfair Lady. The music video received more than 1 million views in less than a month. It topped iTunes, KKBOX, JOOX, MOOV charts as well as achieving a gold song award at the annual JSG Awards Presentation 2017. It also became one of the Top 10 HK YouTube Music Videos of 2017. On June 24, she released "愛近在眼前" (In Front Of Love) as the ending theme song for Legal Mavericks, this also being the second part of her hit song "愛需要勇氣" (Love Takes Courage). She has received nominations for all drama songs in award ceremonies. On 17 June 2018, she performed as a special guest at William So's Father's Day Concert in New York City. On 9 September, she also performed as a special guest at Johnson Lee's Daikin Family Concert. On 22 December 2018, she held her first concert with boyfriend, Fred Cheng, in Los Angeles. On 28 June 2019, Ho released her first single in two years, 包庇 (Tear Can't Speak), working with well-known music producer, Schumann (舒文). On October 8, she released "我會想念他" (Thoughts Of Love) as the ending theme song of Finding Her Voice. On Voice Entertainment's YouTube channel, her most popular songs are "最真心一對" (True Lovers) (5.9M+ views), "愛需要勇氣" (Love Takes Courage) (4.3M+ views) and "我不會撒嬌" (I Would Not Pout) (3.2M+ views). On 30 November 2019, she posted on Instagram announcing she had ended her contract with Voice Entertainment. Independent Singer: 2020–2021 On 11 March 2020, Ho released her first single as an independent singer, "致有夢想的人", written and produced by Cousin Fung. On 26 June 2020, Ho released "絕望時請點播", which was co-written by herself and Cousin Fung, and was produced by Randy Chow. On 10 August 2020, she released the ending theme song of Al Cappuccino, 對手戲 (Opponent), her last drama song with Voice Entertainment. On 19 October 2020, she released "基本戀愛套路", which she also co-wrote with Cousin Fung. On 14 March 2021, she independently released her fourth song, "灰夠". On 15 April 2021, she released her EP, Que Será, Será, which comprised all the songs she had released as an independent singer. On 26 July 2021, she announced on Instagram that she had completed her contract with TVB, for which she had been signed to for 12 years. Moving Pictures: 2023–present In July 2023, Ho announced she had officially joined the record label, Moving Pictures. She released her first single in two years, "the right kind", which she composed herself. Discography Albums Other songs/singles Acting Beginnings: 2009–2013 Ho was only 16 when she participated in The Voice. Subsequently, she signed a contract with TVB which led her into the entertainment industry. Due to balancing her studies, she started off part time, hosting music and travel shows with fellow singers and having cameo appearances in dramas. Participating in Dramas: 2014–2019 In 2014, she scored her first major role in Gilded Chopsticks, acting alongside Wong Cho-lam, which allowed audiences to recognize her as an actress. In 2015, she acted as one of the four main leads in the legal drama, Raising The Bar, as well as singing the opening theme song "我和你" (You & I). While filming the drama, she became best friends with her co-stars, Jeannie Chan, Moon Lau and Grace Chan, and also received a Best Supporting Actress and Most Popular Female Character nomination at the 2015 TVB Anniversary Awards. In 2016, she continued to be cast in dramas such as Love as a Predatory Affair and Dead Wrong, giving her audience a good impression and performance. In 2017, she participated in Recipes to Live By, and received a Best Supporting Actress nomination at the 2017 TVB Anniversary Awards. She was offered a supporting role in the anniversary drama, My Ages Apart, but had to resign after filming a few scenes due to mental illness. Despite her illness, she went to Hengdian to finish filming Succession War, playing the role of Gurun Princess Hexiao which later aired in June 2018. After being inactive in filming dramas for a year, she announced in June 2018 she would be participating in a new drama, Finding Her Voice, which aired in October 2019. Hosting: 2012–2020 Besides acting, Ho also hosts variety, comedy, travel and music shows. During the start of her career, Ho hosted multiple shows with fellow singers. In 2016, she hosted many episodes of I Heart HK with host Eric Tsang as well as many other artistes. In October 2016, Ho, Fred Cheng and Kayee Tam went to Alaska to film travel show, Anchors With Passport 3, which aired in February 2017. In October 2017, she was one of the hosts of the magic show, The Ultimate Street Sorcerer, collaborating with renowned Hong Kong magician Louis Yan. In 2019, she became a guest host of variety show, Liza's Online, working with Liza Wang. Filmography TVB Television Dramas Host Film Music Awards 2010 The Voice (Hong Kong) – Top 5 Viral Songs (On My Own) Approaching The Youngsters Music Contest 2010 (CMB Korea) – 1st Runner-up (Silver) with Alfred Hui 2010 JSG Selections Part 1 – Song (Supervoice) with singers from The Voice (Hong Kong) JSG Awards Presentation 2010 – Outstanding Performance Award (Silver) with singers from The Voice (Hong Kong) 2012 Metro Showbiz Hit Children's Songs 2010 – Hit Children's Song Award (Go! Go! Sunshine) 2014 Metro Showbiz Hit Awards 2014 – New Female Debut Singer Award (Gold) Metro Showbiz Hit Awards 2014 – Hit Duet Award (線上情歌) with Fred Cheung RTHK Top 10 Gold Songs Awards 2014 – Most Promising Future Newcomer Award (Bronze) Canada Most Hit Cantonese Song Charts – Canada's Most Praised New Female Artist JSG Awards Presentation 2014 – Most Popular New Artist (Bronze) IFPI Hong Kong Sales Awards 2014 – Bestselling Female Newcomer Award 2016 2016 JSG Selections Part 1 – Song (最真心一對) (True Lovers) 2016 JSG Selections Part 2 – Song (只想可以跟你走) (Take Me With You) King of Music Global Chinese Music Awards – Best Progress Award Metro Showbiz Hit Awards 2016 – Metro Top 12 Singers JSG Awards Presentation 2016 – Outstanding Performance Award JSG Awards Presentation 2016 – Gold Song (愛需要勇氣) (Love Takes Courage) Cantonese Song Charts Awards – Outstanding Progress Award 2017 2017 JSG Selections Part 1 – Song (我不會撒嬌) (I Would Not Pout) Chinese Golden Melody Awards 2017 – Jumping Singer Award 2017 JSG Selections Part 2 – Song (愛近在眼前) (In Front Of Love) YouTube Top 10 HK Music Video – 9th Place (我不會撒嬌) (I Would Not Pout) JSG Awards Presentation 2017 – Gold Song (我不會撒嬌) (I Would Not Pout) 2020 2020 JSG Selections Part 1 – Song (致有夢想的人) AEG Music Channel Awards 2020 – Diamond Female Singer-Songwriter Award AEG Music Channel Awards 2020 – Diamond Popular Idol Award 2020 JSG Selections Part 2 – Song (對手戲) (Opponent) Metro Showbiz Hit Awards 2020 – Hit Independent Musician Award JSG Awards Presentation 2020 – Gold Song (對手戲) (Opponent) Film Awards and Nominations Starhub TVB Awards TVB Star Awards Malaysia TVB Anniversary Awards References External links Stephanie Ho on Instagram Stephanie Ho on YouTube Stephanie Ho on Facebook Stephanie Ho on Weibo Living people 1992 births Cantopop singers Actresses from San Jose, California 21st-century American women
```xml import { PlaywrightCrawler, ProxyConfiguration } from 'crawlee'; const proxyConfiguration = new ProxyConfiguration({ proxyUrls: [ 'path_to_url 'path_to_url ], }); const crawler = new PlaywrightCrawler({ proxyConfiguration, // ... }); ```
```objective-c // 2016 and later: Unicode, Inc. and others. /* ********************************************************************** * Corporation and others. All Rights Reserved. ********************************************************************** * Date Name Description * 11/10/99 aliu Creation. ********************************************************************** */ #ifndef TRANSTST_H #define TRANSTST_H #include "unicode/utypes.h" #if !UCONFIG_NO_TRANSLITERATION #include "unicode/translit.h" #include "intltest.h" /** * @test * @summary General test of Transliterator */ class TransliteratorTest : public IntlTest { public: TransliteratorTest(); virtual ~TransliteratorTest(); private: void runIndexedTest(int32_t index, UBool exec, const char* &name, char* par=nullptr) override; void TestInstantiation(); void TestSimpleRules(); void TestInlineSet(); void TestAnchors(); void TestPatternQuoting(); /** * Create some inverses and confirm that they work. We have to be * careful how we do this, since the inverses will not be true * inverses -- we can't throw any random string at the composition * of the transliterators and expect the identity function. F x * F' != I. However, if we are careful about the input, we will * get the expected results. */ void TestRuleBasedInverse(); /** * Basic test of keyboard. */ void TestKeyboard(); /** * Basic test of keyboard with cursor. */ void TestKeyboard2(); /** * Test keyboard transliteration with back-replacement. */ void TestKeyboard3(); void keyboardAux(const Transliterator& t, const char* DATA[], int32_t DATA_length); void TestArabic(); /** * Compose the Kana transliterator forward and reverse and try * some strings that should come out unchanged. */ void TestCompoundKana(); /** * Compose the hex transliterators forward and reverse. */ void TestCompoundHex(); /** * Do some basic tests of filtering. */ void TestFiltering(); /** * Regression test for bugs found in Greek transliteration. */ void TestJ277(); /** * Prefix, suffix support in hex transliterators. */ void TestJ243(); /** * Parsers need better syntax error messages. */ void TestJ329(); /** * Test segments and segment references. */ void TestSegments(); /** * Test cursor positioning outside of the key */ void TestCursorOffset(); /** * Test zero length and > 1 char length variable values. Test * use of variable refs in UnicodeSets. */ void TestArbitraryVariableValues(); /** * Confirm that the contextStart, contextLimit, start, and limit * behave correctly. J474. */ void TestPositionHandling(); /** * Test the Hiragana-Katakana transliterator. */ void TestHiraganaKatakana(); /** * Test cloning / copy constructor of RBT. */ void TestCopyJ476(); /** * Test inter-Indic transliterators. These are composed. * ICU4C Jitterbug 483. */ void TestInterIndic(); /** * Test filter syntax in IDs. (J918) */ void TestFilterIDs(); /** * Test the case mapping transliterators. */ void TestCaseMap(); /** * Test the name mapping transliterators. */ void TestNameMap(); /** * Test liberalized ID syntax. 1006c */ void TestLiberalizedID(); /** * Test Jitterbug 912 */ void TestCreateInstance(); void TestNormalizationTransliterator(); void TestCompoundRBT(); void TestCompoundFilter(); void TestRemove(); void TestToRules(); void TestContext(); void TestSupplemental(); void TestQuantifier(); /** * Test Source-Target/Variant. */ void TestSTV(); void TestCompoundInverse(); void TestNFDChainRBT(); /** * Inverse of "Null" should be "Null". (J21) */ void TestNullInverse(); /** * Check ID of inverse of alias. (J22) */ void TestAliasInverseID(); /** * Test IDs of inverses of compound transliterators. (J20) */ void TestCompoundInverseID(); /** * Test undefined variable. */ void TestUndefinedVariable(); /** * Test empty context. */ void TestEmptyContext(); /** * Test compound filter ID syntax */ void TestCompoundFilterID(); /** * Test new property set syntax */ void TestPropertySet(); /** * Test various failure points of the new 2.0 engine. */ void TestNewEngine(); /** * Test quantified segment behavior. We want: * ([abc])+ > x $1 x; applied to "cba" produces "xax" */ void TestQuantifiedSegment(); /* Devanagari-Latin rules Test */ void TestDevanagariLatinRT(); /* Telugu-Latin rules Test */ void TestTeluguLatinRT(); /* Gujarati-Latin rules Test */ void TestGujaratiLatinRT(); /* Sanskrit-Latin rules Test */ void TestSanskritLatinRT(); /* Test Compound Indic-Latin transliterators*/ void TestCompoundLatinRT(); /* Test bindi and tippi for Gurmukhi */ void TestGurmukhiDevanagari(); /** * Test instantiation from a locale. */ void TestLocaleInstantiation(); /** * Test title case handling of accent (should ignore accents) */ void TestTitleAccents(); /** * Basic test of a locale resource based rule. */ void TestLocaleResource(); /** * Make sure parse errors reference the right line. */ void TestParseError(); /** * Make sure sets on output are disallowed. */ void TestOutputSet(); /** * Test the use variable range pragma, making sure that use of * variable range characters is detected and flagged as an error. */ void TestVariableRange(); /** * Test invalid post context error handling */ void TestInvalidPostContext(); /** * Test ID form variants */ void TestIDForms(); /** * Mark's toRules test. */ void TestToRulesMark(); /** * Test Escape and Unescape transliterators. */ void TestEscape(); void TestAnchorMasking(); /** * Make sure display names of variants look reasonable. */ void TestDisplayName(); /** * Check to see if case mapping works correctly. */ void TestSpecialCases(); /** * Check to see that incremental gets at least part way through a reasonable string. */ void TestIncrementalProgress(); /** * Check that casing handles surrogates. */ void TestSurrogateCasing(); void TestFunction(); void TestInvalidBackRef(); void TestMulticharStringSet(); void TestUserFunction(); void TestAnyX(); void TestAny(); void TestSourceTargetSet(); void TestPatternWhiteSpace(); void TestAllCodepoints(); void TestBoilerplate(); void TestAlternateSyntax(); void TestRuleStripping(); void TestHalfwidthFullwidth(); void TestThai(); /** * Tests the multiple-pass syntax */ void TestBeginEnd(); /** * Tests that toRules() works right with the multiple-pass syntax */ void TestBeginEndToRules(); /** * Tests the registerAlias() function */ void TestRegisterAlias(); void TestBasicTransliteratorEvenWithoutData(); //====================================================================== // Support methods //====================================================================== protected: void expectT(const UnicodeString& id, const UnicodeString& source, const UnicodeString& expectedResult); void expect(const UnicodeString& rules, const UnicodeString& source, const UnicodeString& expectedResult, UTransPosition* pos = nullptr); void expect(const UnicodeString& id, const UnicodeString& rules, const UnicodeString& source, const UnicodeString& expectedResult, UTransPosition* pos = nullptr); void expect(const Transliterator& t, const UnicodeString& source, const UnicodeString& expectedResult, const Transliterator& reverseTransliterator); void expect(const Transliterator& t, const UnicodeString& source, const UnicodeString& expectedResult, UTransPosition* pos = nullptr); void expectAux(const UnicodeString& tag, const UnicodeString& source, const UnicodeString& result, const UnicodeString& expectedResult); virtual void expectAux(const UnicodeString& tag, const UnicodeString& summary, UBool pass, const UnicodeString& expectedResult); static UnicodeString& formatInput(UnicodeString &appendTo, const UnicodeString& input, const UTransPosition& pos); void checkRules(const UnicodeString& label, Transliterator& t2, const UnicodeString& testRulesForward); void CheckIncrementalAux(const Transliterator* t, const UnicodeString& input); void reportParseError(const UnicodeString& message, const UParseError& parseError, const UErrorCode& status); const UnicodeString DESERET_DEE; const UnicodeString DESERET_dee; }; #endif /* #if !UCONFIG_NO_TRANSLITERATION */ #endif ```
Roberto Blandon (born Roberto Blandon Jolly; March 8, 1961 in Mexico City) is a television actor in Mexico who starred in soap operas in that country in 1989, including the role of Henry in the soap opera "Mi segunda madre" producer Juan Osorio. He was among the first actors to join the broadcaster TV Azteca, then returned to Televisa. It has also been featured in theater performances and recently found in the soap opera recordings Camaleones. Biography He studied drama and theater in high school performance of Andres Soler in the mid 1980s. He debuted in 1989 under the cast of the telenovela Mi segunda madre playing Henry. In 1990, participating in telenovelas Cuando llega el amor and Amor de nadie of both the producer Carla Estrada, which allowed his name to be increasingly popular within the media. In 1994 made participation in Mujer, casos de la vida real and a year later in 1995 participated in Maria La Del Barrio and José María Cano one of the antagonists of the story, the same year he participated in the telenovela Bajo un mismo rostro playing Alejandro again one of the antagonistic character at the end of the latter includes the production of Para toda la vida. In 1996, makes a special appearance on the soap opera Canción de amor, a year later made Mi querida Isabel the villain in Oscar history, this will be his last soap opera on Televisa in the old millennium and a year later in 1998, integrates the ranks of TV Azteca in the telenovela La Chacala where he played David, one of the main characters. In 1999 Robert made the telenovela El candidato who staged Humberto Zurita and Lorena Rojas playing Adrian Cuevas, in 2000 reunites with actress Lucía Méndez telenovela in Golpe bajo and German Santos one of the antagonists of the story. In 2001, again works with Lorena Rojas in Como en el cineas in love with the protagonist in July, this would be his last participation in TV Azteca. In 2003, resumes his career in Televisa with an antagonistic role on the telenovela Mariana de la noche and Ivan Lugo, later featured in Mujer de madera. In 2006 he took part in the teen telenovela Código Postal as one of the main characters. In 2007, a teen telenovela done again Muchachitas como tu playing Guillermo father of one of the girls played by Gloria Sierra. The same year he made a soap telenovela / comedy Al diablo con los guapos with a temporary character in history as the father of villanita Florence, played by Ariadne Diaz. In 2008 he recorded the pilot episode of the series Mujeres Asesinas in chapter Jessica, toxica with Alejandra Barros and Odiseo Bichir. That year Oscar Cardenas played the villain in the telenovela Un gancho al corazon. In 2009 he worked in the production of Juan Osorio, Mi pecado. Career Filmography Films Television Theatre 12 hombres en pugna La indigación Los 7 ahorcados Canto verde José el soñador Don Quijote de la Mancha El diluvio que viene Galileo Galilei La bella y la bestia Los miserables References External links Biografía en Portal Televisa esmas.com Biografía en Almalatina.com - en idioma inglés 1961 births Living people Mexican male telenovela actors Mexican male television actors Mexican male stage actors Mexican people of English descent Male actors from Mexico City
Sarah E. Diamond is an American ecologist and biologist who is currently the George B. Mayer Chair in Urban and Environmental Studies at Case Western Reserve University in Cleveland, Ohio. A climate scientist, Diamond's research focuses on predicting how ecological and biological systems will respond and adapt to the changing climate. Education Diamond graduated from Bucknell University in 2005 and then gained her Ph.D. in the field of biology from the Kingsolver Lab at the University of North Carolina at Chapel Hill in 2010. Until 2013, she worked as a postdoctoral research assistant in the Department of Biological Sciences at North Carolina State University. Career and research Since 2014, Diamond has been an assistant professor in the Department of Biology at Case Western Reserve University. In 2017, she was appointed as the George B. Mayer Chair in Urban and Environmental Studies. Much of Diamond's research focuses on predicting how ecological systems and biological organisms will respond to novel environments. Utilizing field study, laboratory research, and computational modeling, she examines the environmental forces that drive organisms to change and the mechanisms that organisms may employ in order to evolve and cope. Diamond's research predicts how plants and animals will react to the changing climate and also provides insight into how human behavior affects the mechanisms that force these changes, and how humans may be able to mitigate or avoid those mechanisms. Her work on urban evolution gives an indication of how species may respond to stressors such as temperature change. Species display varying abilities to respond to altered environments through both phenotypic plasticity and genetic evolution. Diamond's work with the acorn ant on urban evolution is helping scientists to better understand how creatures respond to environmental stressors, and how evolution works. Urban environments tend to be hotter and change temperature more rapidly than rural ones. Urban populations of acorn ants have evolved both improved heat tolerance and increased phenotypic plasticity in response to temperature changes in their environment. Diamond also studies the movement of butterfly species, with the help of citizen scientists. Some species are moving into new territory, while others are not. Diamond is studying why, and whether specific traits in different butterfly species relate to their range. Diamond's scientific publications have been cited 3796 times as of April 1, 2022, giving her an h-index of 33. Among Diamond's most-cited publications are two papers on phenotypic selection. In "Synthetic analyses of phenotypic selection in natural populations: lessons, limitations and future directions", she takes a meta-approach towards analyzing the thousands of published estimations of phenotypic selection, and she uses her analysis to consider how these past estimations may guide her future estimations. In "Phenotypic Selection in Natural Populations: What Limits Directional Selection?" Diamond explores the implications of direct selection, which is a form of natural selection that favors dominant genes over non-dominant genes. Awards and recognition 2018, Early Career Fellow, Ecological Society of America 2019, Early Career Development (CAREER) grant, National Science Foundation (NSF) References American ecologists Women ecologists Bucknell University alumni Case Western Reserve University faculty University of North Carolina at Chapel Hill alumni Year of birth missing (living people) Living people American women scientists American women academics 21st-century American women
```smalltalk using System; using System.Collections.Generic; using System.IO; using System.Threading; using System.Threading.Tasks; using AdaptiveCards; using Microsoft.Bot.Builder; using Microsoft.Bot.Builder.Teams; using Microsoft.Bot.Schema; using Microsoft.Bot.Schema.Teams; using Microsoft.Extensions.Configuration; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Microsoft.BotBuilderSamples.Helpers; using Microsoft.BotBuilderSamples.Models; namespace Microsoft.BotBuilderSamples.Bots { public class TeamsMessagingExtensionsActionBot : TeamsActivityHandler { public readonly string baseUrl; public TeamsMessagingExtensionsActionBot(IConfiguration configuration) : base() { this.baseUrl = configuration["BaseUrl"]; } protected override async Task<MessagingExtensionActionResponse> OnTeamsMessagingExtensionSubmitActionAsync(ITurnContext<IInvokeActivity> turnContext, MessagingExtensionAction action, CancellationToken cancellationToken) { switch (action.CommandId) { case "createCard": return CreateCardCommand(turnContext, action); case "shareMessage": return ShareMessageCommand(turnContext, action); case "webView": return WebViewResponse(turnContext, action); case "createAdaptiveCard": return CreateAdaptiveCardResponse(turnContext, action); case "razorView": return RazorViewResponse(turnContext, action); } return await Task.FromResult(new MessagingExtensionActionResponse()); } private MessagingExtensionActionResponse RazorViewResponse(ITurnContext<IInvokeActivity> turnContext, MessagingExtensionAction action) { // The user has chosen to create a card by choosing the 'Create Card' context menu command. RazorViewResponse cardData = JsonConvert.DeserializeObject<RazorViewResponse>(action.Data.ToString()); var card = new HeroCard { Title = "Requested User: " + turnContext.Activity.From.Name, Text = cardData.DisplayData, }; var attachments = new List<MessagingExtensionAttachment>(); attachments.Add(new MessagingExtensionAttachment { Content = card, ContentType = HeroCard.ContentType, Preview = card.ToAttachment(), }); return new MessagingExtensionActionResponse { ComposeExtension = new MessagingExtensionResult { AttachmentLayout = "list", Type = "result", Attachments = attachments, }, }; } private MessagingExtensionActionResponse CreateCardCommand(ITurnContext<IInvokeActivity> turnContext, MessagingExtensionAction action) { // The user has chosen to create a card by choosing the 'Create Card' context menu command. var createCardData = ((JObject)action.Data).ToObject<CardResponse>(); var card = new HeroCard { Title = createCardData.Title, Subtitle = createCardData.Subtitle, Text = createCardData.Text, }; var attachments = new List<MessagingExtensionAttachment>(); attachments.Add(new MessagingExtensionAttachment { Content = card, ContentType = HeroCard.ContentType, Preview = card.ToAttachment(), }); return new MessagingExtensionActionResponse { ComposeExtension = new MessagingExtensionResult { AttachmentLayout = "list", Type = "result", Attachments = attachments, }, }; } private MessagingExtensionActionResponse ShareMessageCommand(ITurnContext<IInvokeActivity> turnContext, MessagingExtensionAction action) { // The user has chosen to share a message by choosing the 'Share Message' context menu command. var heroCard = new HeroCard { Title = $"{action.MessagePayload.From?.User?.DisplayName} orignally sent this message:", Text = action.MessagePayload.Body.Content, }; if (action.MessagePayload.Attachments != null && action.MessagePayload.Attachments.Count > 0) { // This sample does not add the MessagePayload Attachments. This is left as an // exercise for the user. heroCard.Subtitle = $"({action.MessagePayload.Attachments.Count} Attachments not included)"; } // This Messaging Extension example allows the user to check a box to include an image with the // shared message. This demonstrates sending custom parameters along with the message payload. var includeImage = ((JObject)action.Data)["includeImage"]?.ToString(); if (string.Equals(includeImage, bool.TrueString, StringComparison.OrdinalIgnoreCase)) { heroCard.Images = new List<CardImage> { new CardImage { Url = "path_to_url" }, }; } return new MessagingExtensionActionResponse { ComposeExtension = new MessagingExtensionResult { Type = "result", AttachmentLayout = "list", Attachments = new List<MessagingExtensionAttachment>() { new MessagingExtensionAttachment { Content = heroCard, ContentType = HeroCard.ContentType, Preview = heroCard.ToAttachment(), }, }, }, }; } private MessagingExtensionActionResponse WebViewResponse(ITurnContext<IInvokeActivity> turnContext, MessagingExtensionAction action) { // The user has chosen to create a card by choosing the 'Web View' context menu command. CustomFormResponse cardData = JsonConvert.DeserializeObject<CustomFormResponse>(action.Data.ToString()); var imgUrl = baseUrl + "/MSFT_logo.jpg"; var card = new ThumbnailCard { Title = "ID: " + cardData.EmpId, Subtitle = "Name: " + cardData.EmpName, Text = "E-Mail: " + cardData.EmpEmail, Images = new List<CardImage> { new CardImage { Url = imgUrl } }, }; var attachments = new List<MessagingExtensionAttachment>(); attachments.Add(new MessagingExtensionAttachment { Content = card, ContentType = ThumbnailCard.ContentType, Preview = card.ToAttachment(), }); return new MessagingExtensionActionResponse { ComposeExtension = new MessagingExtensionResult { AttachmentLayout = "list", Type = "result", Attachments = attachments, }, }; } private MessagingExtensionActionResponse CreateAdaptiveCardResponse(ITurnContext<IInvokeActivity> turnContext, MessagingExtensionAction action) { var createCardResponse = ((JObject)action.Data).ToObject<CardResponse>(); var attachments = CardHelper.CreateAdaptiveCardAttachment(action, createCardResponse); return new MessagingExtensionActionResponse { ComposeExtension = new MessagingExtensionResult { AttachmentLayout = "list", Type = "result", Attachments = attachments, }, }; } protected override async Task<MessagingExtensionActionResponse> OnTeamsMessagingExtensionFetchTaskAsync(ITurnContext<IInvokeActivity> turnContext, MessagingExtensionAction action, CancellationToken cancellationToken) { switch (action.CommandId) { case "webView": return EmpDetails(turnContext, action); case "HTML": return TaskModuleHTMLPage(turnContext, action); case "razorView": return DateDayInfo(turnContext, action); default: // we are handling two cases within try/catch block //if the bot is installed it will create adaptive card attachment and show card with input fields string memberName; try { // Check if your app is installed by fetching member information. var member = await TeamsInfo.GetMemberAsync(turnContext, turnContext.Activity.From.Id, cancellationToken); memberName = member.Name; } catch (ErrorResponseException ex) { if (ex.Body.Error.Code == "BotNotInConversationRoster") { return new MessagingExtensionActionResponse { Task = new TaskModuleContinueResponse { Value = new TaskModuleTaskInfo { Card = GetAdaptiveCardAttachmentFromFile("justintimeinstallation.json"), Height = 200, Width = 400, Title = "Adaptive Card - App Installation", }, }, }; } throw; // It's a different error. } return new MessagingExtensionActionResponse { Task = new TaskModuleContinueResponse { Value = new TaskModuleTaskInfo { Card = GetAdaptiveCardAttachmentFromFile("adaptiveCard.json"), Height = 200, Width = 400, Title = $"Welcome {memberName}", }, }, }; } } private MessagingExtensionActionResponse DateDayInfo(ITurnContext<IInvokeActivity> turnContext, MessagingExtensionAction action) { var response = new MessagingExtensionActionResponse() { Task = new TaskModuleContinueResponse() { Value = new TaskModuleTaskInfo() { Height = 175, Width = 300, Title = "Task Module Razor View", Url = baseUrl + "/Home/RazorView", }, }, }; return response; } private MessagingExtensionActionResponse TaskModuleHTMLPage(ITurnContext<IInvokeActivity> turnContext, MessagingExtensionAction action) { var response = new MessagingExtensionActionResponse() { Task = new TaskModuleContinueResponse() { Value = new TaskModuleTaskInfo() { Height = 200, Width = 400, Title = "Task Module HTML Page", Url = baseUrl + "/htmlpage.html", }, }, }; return response; } private MessagingExtensionActionResponse EmpDetails(ITurnContext<IInvokeActivity> turnContext, MessagingExtensionAction action) { var response = new MessagingExtensionActionResponse() { Task = new TaskModuleContinueResponse() { Value = new TaskModuleTaskInfo() { Height = 300, Width = 450, Title = "Task Module WebView", Url = baseUrl + "/Home/CustomForm", }, }, }; return response; } private static Attachment GetAdaptiveCardAttachmentFromFile(string fileName) { //Read the card json and create attachment. string[] paths = { ".", "Resources", fileName }; var adaptiveCardJson = File.ReadAllText(Path.Combine(paths)); var adaptiveCardAttachment = new Attachment() { ContentType = "application/vnd.microsoft.card.adaptive", Content = JsonConvert.DeserializeObject(adaptiveCardJson), }; return adaptiveCardAttachment; } } } ```
```c++ // 2016 and later: Unicode, Inc. and others. /* ****************************************************************************** * Corporation and others. All Rights Reserved. ****************************************************************************** * quantityformatter.cpp */ #include "unicode/utypes.h" #if !UCONFIG_NO_FORMATTING #include "unicode/simpleformatter.h" #include "quantityformatter.h" #include "uassert.h" #include "unicode/unistr.h" #include "unicode/decimfmt.h" #include "cstring.h" #include "unicode/plurrule.h" #include "charstr.h" #include "unicode/fmtable.h" #include "unicode/fieldpos.h" #include "standardplural.h" #include "uassert.h" #include "number_decimalquantity.h" #include "number_utypes.h" #include "formatted_string_builder.h" U_NAMESPACE_BEGIN QuantityFormatter::QuantityFormatter() { for (int32_t i = 0; i < UPRV_LENGTHOF(formatters); ++i) { formatters[i] = NULL; } } QuantityFormatter::QuantityFormatter(const QuantityFormatter &other) { for (int32_t i = 0; i < UPRV_LENGTHOF(formatters); ++i) { if (other.formatters[i] == NULL) { formatters[i] = NULL; } else { formatters[i] = new SimpleFormatter(*other.formatters[i]); } } } QuantityFormatter &QuantityFormatter::operator=( const QuantityFormatter& other) { if (this == &other) { return *this; } for (int32_t i = 0; i < UPRV_LENGTHOF(formatters); ++i) { delete formatters[i]; if (other.formatters[i] == NULL) { formatters[i] = NULL; } else { formatters[i] = new SimpleFormatter(*other.formatters[i]); } } return *this; } QuantityFormatter::~QuantityFormatter() { for (int32_t i = 0; i < UPRV_LENGTHOF(formatters); ++i) { delete formatters[i]; } } void QuantityFormatter::reset() { for (int32_t i = 0; i < UPRV_LENGTHOF(formatters); ++i) { delete formatters[i]; formatters[i] = NULL; } } UBool QuantityFormatter::addIfAbsent( const char *variant, const UnicodeString &rawPattern, UErrorCode &status) { int32_t pluralIndex = StandardPlural::indexFromString(variant, status); if (U_FAILURE(status)) { return FALSE; } if (formatters[pluralIndex] != NULL) { return TRUE; } SimpleFormatter *newFmt = new SimpleFormatter(rawPattern, 0, 1, status); if (newFmt == NULL) { status = U_MEMORY_ALLOCATION_ERROR; return FALSE; } if (U_FAILURE(status)) { delete newFmt; return FALSE; } formatters[pluralIndex] = newFmt; return TRUE; } UBool QuantityFormatter::isValid() const { return formatters[StandardPlural::OTHER] != NULL; } const SimpleFormatter *QuantityFormatter::getByVariant( const char *variant) const { U_ASSERT(isValid()); int32_t pluralIndex = StandardPlural::indexOrOtherIndexFromString(variant); const SimpleFormatter *pattern = formatters[pluralIndex]; if (pattern == NULL) { pattern = formatters[StandardPlural::OTHER]; } return pattern; } UnicodeString &QuantityFormatter::format( const Formattable &number, const NumberFormat &fmt, const PluralRules &rules, UnicodeString &appendTo, FieldPosition &pos, UErrorCode &status) const { UnicodeString formattedNumber; StandardPlural::Form p = selectPlural(number, fmt, rules, formattedNumber, pos, status); if (U_FAILURE(status)) { return appendTo; } const SimpleFormatter *pattern = formatters[p]; if (pattern == NULL) { pattern = formatters[StandardPlural::OTHER]; if (pattern == NULL) { status = U_INVALID_STATE_ERROR; return appendTo; } } return format(*pattern, formattedNumber, appendTo, pos, status); } // The following methods live here so that class PluralRules does not depend on number formatting, // and the SimpleFormatter does not depend on FieldPosition. StandardPlural::Form QuantityFormatter::selectPlural( const Formattable &number, const NumberFormat &fmt, const PluralRules &rules, UnicodeString &formattedNumber, FieldPosition &pos, UErrorCode &status) { if (U_FAILURE(status)) { return StandardPlural::OTHER; } UnicodeString pluralKeyword; const DecimalFormat *decFmt = dynamic_cast<const DecimalFormat *>(&fmt); if (decFmt != NULL) { number::impl::DecimalQuantity dq; decFmt->formatToDecimalQuantity(number, dq, status); if (U_FAILURE(status)) { return StandardPlural::OTHER; } pluralKeyword = rules.select(dq); decFmt->format(number, formattedNumber, pos, status); } else { if (number.getType() == Formattable::kDouble) { pluralKeyword = rules.select(number.getDouble()); } else if (number.getType() == Formattable::kLong) { pluralKeyword = rules.select(number.getLong()); } else if (number.getType() == Formattable::kInt64) { pluralKeyword = rules.select((double) number.getInt64()); } else { status = U_ILLEGAL_ARGUMENT_ERROR; return StandardPlural::OTHER; } fmt.format(number, formattedNumber, pos, status); } return StandardPlural::orOtherFromString(pluralKeyword); } void QuantityFormatter::formatAndSelect( double quantity, const NumberFormat& fmt, const PluralRules& rules, FormattedStringBuilder& output, StandardPlural::Form& pluralForm, UErrorCode& status) { UnicodeString pluralKeyword; const DecimalFormat* df = dynamic_cast<const DecimalFormat*>(&fmt); if (df != nullptr) { number::impl::UFormattedNumberData fn; fn.quantity.setToDouble(quantity); const number::LocalizedNumberFormatter* lnf = df->toNumberFormatter(status); if (U_FAILURE(status)) { return; } lnf->formatImpl(&fn, status); if (U_FAILURE(status)) { return; } output = std::move(fn.getStringRef()); pluralKeyword = rules.select(fn.quantity); } else { UnicodeString result; fmt.format(quantity, result, status); if (U_FAILURE(status)) { return; } // This code path is probably RBNF. Use the generic numeric field. output.append(result, kGeneralNumericField, status); if (U_FAILURE(status)) { return; } pluralKeyword = rules.select(quantity); } pluralForm = StandardPlural::orOtherFromString(pluralKeyword); } UnicodeString &QuantityFormatter::format( const SimpleFormatter &pattern, const UnicodeString &value, UnicodeString &appendTo, FieldPosition &pos, UErrorCode &status) { if (U_FAILURE(status)) { return appendTo; } const UnicodeString *param = &value; int32_t offset; pattern.formatAndAppend(&param, 1, appendTo, &offset, 1, status); if (pos.getBeginIndex() != 0 || pos.getEndIndex() != 0) { if (offset >= 0) { pos.setBeginIndex(pos.getBeginIndex() + offset); pos.setEndIndex(pos.getEndIndex() + offset); } else { pos.setBeginIndex(0); pos.setEndIndex(0); } } return appendTo; } U_NAMESPACE_END #endif /* #if !UCONFIG_NO_FORMATTING */ ```
Retrotope, Inc. is a drug development company advancing the idea that polyunsaturated fatty acids (PUFA) drugs fortified with heavy isotopes (reinforced lipids) protect living cells by making bonds within the delicate molecules inside and around cells harder to break. This makes the cells less prone to damage caused by reactive oxygen species (ROS), one of the principal causes of ageing and age-associated diseases. Founded in 2006 by entrepreneurs and scientists with seed funding from private investors, Retrotope is developing a non-antioxidant approach to preventing lipid peroxidation, a detrimental factor in mitochondrial, neuronal, and retinal diseases. The company employs the virtual business model and works in scientific collaboration with more than 80 research groups in universities worldwide. Development Retrotope's drug platform, deuterium-stabilized polyunsaturated fatty acids (PUFA), prevents lipid peroxidation damage from propagating, rapidly stopping the toxic chain reaction at its source. Because the fatty acids in mitochondrial and cellular membranes turn over rapidly, the dietary substitution of stabilized fatty acids creates cells fortified against damage due to kinetic isotope effect. 11,11-D2-ethyl linoleate suppresses lipid peroxidation even at relatively low levels of incorporation into membranes. In 2010 Retrotope found that it more than 150 times increases the resistance of the yeast to oxidative stress, later it was shown to be effective in an animal model of Alzheimer's disease. A June 2018 study found that a diet of D-PUFA was shown to significantly decrease F2-isoprostanes (a cerebrospinal fluid found in elevated amounts in Huntington's disease) when fed to one-month old mice over the course of five months. These findings caused discussion in popular science press about the use of deuterated nutrients against ageing, but the most promising direction of further development was toward rare neurodegenerative diseases in which oxidative damage plays a part. Clinical trials Friedreich's ataxia The first deuterated PUFA made and studied by Retrotope, 11,11-D2-ethyl linoleate, has become the first Retrotope's drug RT001 that was taken into the clinic. It has passed Phase I/II clinical trial for the treatment of Friedreich's ataxia (FA), in which RT001 was shown to be safe, well tolerated and beneficial in terms of improving motor capability in FA patients. However, this preliminary evidence must be interpreted with caution given the limited sample size and the short duration of the study. Phospholipase 2G6-associated neurodegeneration In 2017 FDA granted RT001 orphan drug designation in the treatment of phospholipase 2G6-associated neurodegeneration (PLAN). Infantile neuroaxonal dystrophy A Phase II open-label clinical study for long-term evaluation of efficacy, safety, tolerability, and pharmacokinetics of RT001 in the treatment of infantile neuroaxonal dystrophy started in the Summer 2018. Other clinical use Amyotrophic lateral sclerosis After a petition for access filed by investigators at major medical centers, in 2018 RT001 was given to a patient with amyotrophic lateral sclerosis (ALS) under a "compassionate use" scheme sponsored by Retrotope. Progressive supranuclear palsy In 2020 FDA granted orphan drug designation RT001 for the treatment of patients with progressive supranuclear palsy (PSP). PSP is a disease involving modification and dysfunction of tau protein; RT001's mechanism of action both lowers lipid peroxidation and prevents mitochondrial cell death of neurons which is associated with disease onset and progression. References Pharmaceutical companies of the United States
```go // // Use of this source code is governed by an MIT-style // license that can be found in the LICENSE file. //go:build sqlite_secure_delete_fast // +build sqlite_secure_delete_fast package sqlite3 /* #cgo CFLAGS: -DSQLITE_SECURE_DELETE=FAST #cgo LDFLAGS: -lm */ import "C" ```
```php <?php /* * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the */ namespace Google\Service\CertificateAuthorityService; class SubordinateConfigChain extends \Google\Collection { protected $collection_key = 'pemCertificates'; /** * @var string[] */ public $pemCertificates; /** * @param string[] */ public function setPemCertificates($pemCertificates) { $this->pemCertificates = $pemCertificates; } /** * @return string[] */ public function getPemCertificates() { return $this->pemCertificates; } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(SubordinateConfigChain::class, your_sha256_hashn'); ```
```c /* * * in the file LICENSE in the source distribution or at * path_to_url */ #include "des_local.h" /* * The input and output encrypted as though 64bit ofb mode is being used. * The extra state information to record how much of the 64bit block we have * used is contained in *num; */ void DES_ede3_ofb64_encrypt(register const unsigned char *in, register unsigned char *out, long length, DES_key_schedule *k1, DES_key_schedule *k2, DES_key_schedule *k3, DES_cblock *ivec, int *num) { register DES_LONG v0, v1; register int n = *num; register long l = length; DES_cblock d; register char *dp; DES_LONG ti[2]; unsigned char *iv; int save = 0; iv = &(*ivec)[0]; c2l(iv, v0); c2l(iv, v1); ti[0] = v0; ti[1] = v1; dp = (char *)d; l2c(v0, dp); l2c(v1, dp); while (l--) { if (n == 0) { /* ti[0]=v0; */ /* ti[1]=v1; */ DES_encrypt3(ti, k1, k2, k3); v0 = ti[0]; v1 = ti[1]; dp = (char *)d; l2c(v0, dp); l2c(v1, dp); save++; } *(out++) = *(in++) ^ d[n]; n = (n + 1) & 0x07; } if (save) { iv = &(*ivec)[0]; l2c(v0, iv); l2c(v1, iv); } v0 = v1 = ti[0] = ti[1] = 0; *num = n; } ```
```c /* * Alpha optimized DSP utils * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * You should have received a copy of the GNU Lesser General Public * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libavutil/attributes.h" #include "libavcodec/me_cmp.h" #include "asm.h" int pix_abs16x16_mvi_asm(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); static inline uint64_t avg2(uint64_t a, uint64_t b) { return (a | b) - (((a ^ b) & BYTE_VEC(0xfe)) >> 1); } static inline uint64_t avg4(uint64_t l1, uint64_t l2, uint64_t l3, uint64_t l4) { uint64_t r1 = ((l1 & ~BYTE_VEC(0x03)) >> 2) + ((l2 & ~BYTE_VEC(0x03)) >> 2) + ((l3 & ~BYTE_VEC(0x03)) >> 2) + ((l4 & ~BYTE_VEC(0x03)) >> 2); uint64_t r2 = (( (l1 & BYTE_VEC(0x03)) + (l2 & BYTE_VEC(0x03)) + (l3 & BYTE_VEC(0x03)) + (l4 & BYTE_VEC(0x03)) + BYTE_VEC(0x02)) >> 2) & BYTE_VEC(0x03); return r1 + r2; } static int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int result = 0; if ((size_t) pix2 & 0x7) { /* works only when pix2 is actually unaligned */ do { /* do 8 pixel a time */ uint64_t p1, p2; p1 = ldq(pix1); p2 = uldq(pix2); result += perr(p1, p2); pix1 += line_size; pix2 += line_size; } while (--h); } else { do { uint64_t p1, p2; p1 = ldq(pix1); p2 = ldq(pix2); result += perr(p1, p2); pix1 += line_size; pix2 += line_size; } while (--h); } return result; } #if 0 /* now done in assembly */ int pix_abs16x16_mvi(uint8_t *pix1, uint8_t *pix2, int line_size) { int result = 0; int h = 16; if ((size_t) pix2 & 0x7) { /* works only when pix2 is actually unaligned */ do { /* do 16 pixel a time */ uint64_t p1_l, p1_r, p2_l, p2_r; uint64_t t; p1_l = ldq(pix1); p1_r = ldq(pix1 + 8); t = ldq_u(pix2 + 8); p2_l = extql(ldq_u(pix2), pix2) | extqh(t, pix2); p2_r = extql(t, pix2) | extqh(ldq_u(pix2 + 16), pix2); pix1 += line_size; pix2 += line_size; result += perr(p1_l, p2_l) + perr(p1_r, p2_r); } while (--h); } else { do { uint64_t p1_l, p1_r, p2_l, p2_r; p1_l = ldq(pix1); p1_r = ldq(pix1 + 8); p2_l = ldq(pix2); p2_r = ldq(pix2 + 8); pix1 += line_size; pix2 += line_size; result += perr(p1_l, p2_l) + perr(p1_r, p2_r); } while (--h); } return result; } #endif static int pix_abs16x16_x2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int result = 0; uint64_t disalign = (size_t) pix2 & 0x7; switch (disalign) { case 0: do { uint64_t p1_l, p1_r, p2_l, p2_r; uint64_t l, r; p1_l = ldq(pix1); p1_r = ldq(pix1 + 8); l = ldq(pix2); r = ldq(pix2 + 8); p2_l = avg2(l, (l >> 8) | ((uint64_t) r << 56)); p2_r = avg2(r, (r >> 8) | ((uint64_t) pix2[16] << 56)); pix1 += line_size; pix2 += line_size; result += perr(p1_l, p2_l) + perr(p1_r, p2_r); } while (--h); break; case 7: /* |.......l|lllllllr|rrrrrrr*| This case is special because disalign1 would be 8, which gets treated as 0 by extqh. At least it is a bit faster that way :) */ do { uint64_t p1_l, p1_r, p2_l, p2_r; uint64_t l, m, r; p1_l = ldq(pix1); p1_r = ldq(pix1 + 8); l = ldq_u(pix2); m = ldq_u(pix2 + 8); r = ldq_u(pix2 + 16); p2_l = avg2(extql(l, disalign) | extqh(m, disalign), m); p2_r = avg2(extql(m, disalign) | extqh(r, disalign), r); pix1 += line_size; pix2 += line_size; result += perr(p1_l, p2_l) + perr(p1_r, p2_r); } while (--h); break; default: do { uint64_t disalign1 = disalign + 1; uint64_t p1_l, p1_r, p2_l, p2_r; uint64_t l, m, r; p1_l = ldq(pix1); p1_r = ldq(pix1 + 8); l = ldq_u(pix2); m = ldq_u(pix2 + 8); r = ldq_u(pix2 + 16); p2_l = avg2(extql(l, disalign) | extqh(m, disalign), extql(l, disalign1) | extqh(m, disalign1)); p2_r = avg2(extql(m, disalign) | extqh(r, disalign), extql(m, disalign1) | extqh(r, disalign1)); pix1 += line_size; pix2 += line_size; result += perr(p1_l, p2_l) + perr(p1_r, p2_r); } while (--h); break; } return result; } static int pix_abs16x16_y2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int result = 0; if ((size_t) pix2 & 0x7) { uint64_t t, p2_l, p2_r; t = ldq_u(pix2 + 8); p2_l = extql(ldq_u(pix2), pix2) | extqh(t, pix2); p2_r = extql(t, pix2) | extqh(ldq_u(pix2 + 16), pix2); do { uint64_t p1_l, p1_r, np2_l, np2_r; uint64_t t; p1_l = ldq(pix1); p1_r = ldq(pix1 + 8); pix2 += line_size; t = ldq_u(pix2 + 8); np2_l = extql(ldq_u(pix2), pix2) | extqh(t, pix2); np2_r = extql(t, pix2) | extqh(ldq_u(pix2 + 16), pix2); result += perr(p1_l, avg2(p2_l, np2_l)) + perr(p1_r, avg2(p2_r, np2_r)); pix1 += line_size; p2_l = np2_l; p2_r = np2_r; } while (--h); } else { uint64_t p2_l, p2_r; p2_l = ldq(pix2); p2_r = ldq(pix2 + 8); do { uint64_t p1_l, p1_r, np2_l, np2_r; p1_l = ldq(pix1); p1_r = ldq(pix1 + 8); pix2 += line_size; np2_l = ldq(pix2); np2_r = ldq(pix2 + 8); result += perr(p1_l, avg2(p2_l, np2_l)) + perr(p1_r, avg2(p2_r, np2_r)); pix1 += line_size; p2_l = np2_l; p2_r = np2_r; } while (--h); } return result; } static int pix_abs16x16_xy2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int result = 0; uint64_t p1_l, p1_r; uint64_t p2_l, p2_r, p2_x; p1_l = ldq(pix1); p1_r = ldq(pix1 + 8); if ((size_t) pix2 & 0x7) { /* could be optimized a lot */ p2_l = uldq(pix2); p2_r = uldq(pix2 + 8); p2_x = (uint64_t) pix2[16] << 56; } else { p2_l = ldq(pix2); p2_r = ldq(pix2 + 8); p2_x = ldq(pix2 + 16) << 56; } do { uint64_t np1_l, np1_r; uint64_t np2_l, np2_r, np2_x; pix1 += line_size; pix2 += line_size; np1_l = ldq(pix1); np1_r = ldq(pix1 + 8); if ((size_t) pix2 & 0x7) { /* could be optimized a lot */ np2_l = uldq(pix2); np2_r = uldq(pix2 + 8); np2_x = (uint64_t) pix2[16] << 56; } else { np2_l = ldq(pix2); np2_r = ldq(pix2 + 8); np2_x = ldq(pix2 + 16) << 56; } result += perr(p1_l, avg4( p2_l, ( p2_l >> 8) | ((uint64_t) p2_r << 56), np2_l, (np2_l >> 8) | ((uint64_t) np2_r << 56))) + perr(p1_r, avg4( p2_r, ( p2_r >> 8) | ((uint64_t) p2_x), np2_r, (np2_r >> 8) | ((uint64_t) np2_x))); p1_l = np1_l; p1_r = np1_r; p2_l = np2_l; p2_r = np2_r; p2_x = np2_x; } while (--h); return result; } av_cold void ff_me_cmp_init_alpha(MECmpContext *c, AVCodecContext *avctx) { /* amask clears all bits that correspond to present features. */ if (amask(AMASK_MVI) == 0) { c->sad[0] = pix_abs16x16_mvi_asm; c->sad[1] = pix_abs8x8_mvi; c->pix_abs[0][0] = pix_abs16x16_mvi_asm; c->pix_abs[1][0] = pix_abs8x8_mvi; c->pix_abs[0][1] = pix_abs16x16_x2_mvi; c->pix_abs[0][2] = pix_abs16x16_y2_mvi; c->pix_abs[0][3] = pix_abs16x16_xy2_mvi; } } ```
Euchaetis is a genus of moths of the family Oecophoridae. Species Euchaetis coccoscela (Turner, 1946) Euchaetis crypsichroa Lower, 1893 Euchaetis cryptorrhoda (Turner, 1946) Euchaetis endoleuca Meyrick, 1888 Euchaetis euspilomela (Lower, 1893) Euchaetis habrocosma Meyrick, 1883 Euchaetis holoclera Meyrick, 1888 Euchaetis incarnatella (Walker, 1864) Euchaetis inceptella (Walker, 1864) Euchaetis inclusella (Walker, 1864) Euchaetis insana (Meyrick, 1921) Euchaetis iospila Meyrick, 1888 Euchaetis iozona (Lower, 1893) Euchaetis metallota Meyrick, 1883 Euchaetis parthenopa (Meyrick, 1883) Euchaetis poliarcha Meyrick, 1888 Euchaetis rhizobola Meyrick, 1888 Euchaetis rhodochila (Turner, 1946) Euchaetis rufogrisea (Meyrick, 1883) References Markku Savela's ftp.funet.fi Oecophorinae Moth genera
The OnePlus 7T and 7T Pro are Android-based smartphones manufactured by OnePlus. The 7T was unveiled on 26 September 2019, and the 7T Pro was unveiled on 10 October 2019. The McLaren edition from the 6T returns on the 7T Pro. Both have minor upgrades as with previous T phones, such as new software, upgraded cameras and a faster chipset. Specifications Design The 7T and 7T Pro's designs are similar to their predecessors, with an anodized aluminum frame and Gorilla Glass on both the front and back. The 7T has a near-full screen display with an 86.5% screen-to-body ratio; a small notch at the top of the phone houses the front camera. The camera module on the rear is now circular, with the flash located inside the lens. The 7T Pro is nearly identical to the 7 Pro externally with an 88.1% screen-to-body ratio. The 7T is available in Frosted Silver and Glacial Blue, both of which have a matte finish, and the 7T Pro is available in Haze Blue, which is a lighter shade than the 7 Pro's Nebula Blue. Hardware Internally, both the 7T and 7T Pro use the Snapdragon 855+ processor with the Adreno 640 GPU, both of which have a higher clock speed than the chipset used in the 7 and 7 Pro. They are available with either 128 or 256 GB of non-expandable UFS 3.0 storage and 8 GB of LPDDR4X RAM. A 6.55-inch (166.4mm) 1080p (1080 × 2400) AMOLED display is used with a wider 20:9 aspect ratio, while retaining the 90 Hz refresh rate of the 7 Pro. The 7T Pro's display remains the same, with a curved 6.67-inch (169.4mm) 19.5:9 1440p (1440 × 3120) 90 Hz AMOLED. Both have stereo speakers with active noise cancellation, although the audio jack is still omitted. The 7T uses a 3800 mAh battery, while the 7T Pro uses a 4085 mAh battery which is marginally larger than the 7 Pro's. Power and data connections are provided through the USB-C port; fast charging is supported at 30W. Warp Charge 30T is now supported, which is 23% faster than Warp Charge 30 which was used on the 7 Pro. Biometric options include an optical (under-screen) fingerprint sensor and facial recognition. Camera A 16 MP f/2.0 sensor is used for the front camera, while the rear has an upgraded triple camera setup. The 7T Pro uses a mechanized pop-up camera like on the 7 Pro. The array on both phones consists of a primary lens, a telephoto (zoom) lens, and an ultrawide lens. The primary wide lens has a 48 MP sensor, while a 16 MP sensor is used for the ultrawide lens and a 12 MP sensor is used for the telephoto lens. The 7T Pro's camera hardware is unchanged, with a 48 MP lens, a 16 MP ultrawide lens and an 8 MP telephoto lens, but it can now record ultra slow-motion 720p video at 960 fps (the 7T also receives the same upgraded slow-motion capabilities) and the laser autofocus has been relocated to the left of the camera. While the 7T's telephoto lens benefits from an increase in resolution and a wider f/2.2 aperture, it lacks the 7T Pro's optical image stabilization and laser autofocus and only has 2x optical zoom compared to the 7T Pro's 3x optical zoom, resulting in a smaller 51 mm focal length opposed to the 7T Pro's 78 mm focal length. The ultrawide lens has also been upgraded; it is 17 mm compared to 13 mm on the 7T Pro. Additionally, both phones benefit from a new macro mode which allows users to take photos from as close as 2.5 cm away from the subject. A new Hybrid Image Stabilization for video is also available, and Portrait Mode and Night Scape can now be used on the wide and ultrawide lenses respectively. Software The 7T and 7T Pro run on OxygenOS 11, which is based on Android 11. Network compatibility The OnePlus 7T Pro will only be available in Europe, India, China and Hong Kong. Variants Both the OnePlus 7T and OnePlus 7T Pro have several variants. The differences are usually with the supported bands. McLaren Edition The McLaren edition is the luxurious more exclusive variant of the 7T Pro with 12 GB of RAM and a unique design. The back has a wood-like finish inspired by the Speedtail, and bright orange accents surround the edges and camera module. The software also receives a special theme, while a carbon fiber/alcantara case is included in the box. A 5G variant was announced later, exclusive to T-Mobile. Reception The OnePlus 7T received positive reviews overall, with praise being directed at the display, performance, cameras and software. Dan Seifert of The Verge remarked that the camera experience remained largely the same as on the 7 Pro and battery life was just average, and Andy Boxall of Digital Trends noted that the display seemed muted even when the Vivid color mode was selected. The lack of water resistance, wireless charging and a MicroSD card slot were also seen as downsides. The 7T Pro was reviewed favorably as well. The OnePlus 7T Pro won the best smartphone of 2019 title at the GSMA awards. References External links OnePlus mobile phones Mobile phones introduced in 2019 Mobile phones with multiple rear cameras Mobile phones with 4K video recording
```php <?php /* * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the */ namespace Google\Service\HangoutsChat; class UpdatedWidget extends \Google\Model { protected $suggestionsType = SelectionItems::class; protected $suggestionsDataType = ''; /** * @var string */ public $widget; /** * @param SelectionItems */ public function setSuggestions(SelectionItems $suggestions) { $this->suggestions = $suggestions; } /** * @return SelectionItems */ public function getSuggestions() { return $this->suggestions; } /** * @param string */ public function setWidget($widget) { $this->widget = $widget; } /** * @return string */ public function getWidget() { return $this->widget; } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(UpdatedWidget::class, 'Google_Service_HangoutsChat_UpdatedWidget'); ```
German railway route numbers (German:Streckennummern) are used to designate and identify railway routes, or sections of routes, within Germany. In Germany, there are a total of 3 different numbering systems used by the Deutsche Bahn, which meet different requirements. These systems are: VzG line numbers (four digit, unambiguous identification of a railway line) Timetabled route numbers (three digit, Kursbuchstrecke referring to a route of passenger services) Restricted speed section (La) route numbers (one to three digit) In addition there are numbers in the railway operators' timetables; these are not covered here. Sources Eisenbahnatlas Deutschland, Ausgabe 2007/2008, Schweers & Wall, Das große Archiv der Eisenbahnstrecken in Deutschland, Herausgeber Ernst Huber, Geranova Hans-Jürgen Geisler: DB-Streckendaten – STREDA, Eisenbahningenieur (49) 12/1998 External links DB Netz AG TPS route pricing system Table with route numbers (Microsoft Excel file, 362 kb) Explanation of VzG route numbers Railway land register History of German railway infrastructure Railway lines in Germany
Acianthera appendiculata is a species of orchid plant native to the Dominican Republic. References appendiculata Flora of the Dominican Republic Plants described in 1912 Flora without expected TNC conservation status Taxa named by Alfred Cogniaux
The Ombatse group is a militia group in Nasarawa Egon, a Local Government Area of Nasarawa State, northern Nigeria. In May 2013, the group was reported to have killed 74 police officers and 10 State Security Service officers. The deadly attack was led by the leader of the group, Baba Alakyo, the chief priest of Alakyo Village of Nasarawa Egon. Controversies There are controversies on whether there is a link between the militia group and the Boko Haram Islamic insurgents in northeastern Nigeria but there seems to be no clear evidence of any relationship between the groups. On November 17, 2014, it was reported that the leader of the militia group, Baba Alakyo was killed by unknown gunmen suspected to be Fulani herdsmen, a claim that was refuted by the legal adviser to the Ombatse group, Zachary Zamani Alumaga. References Militant Sufi organisations
Alex Bachman (born May 29, 1996) is an American football wide receiver who is a free agent. He played college football at Wake Forest. College career Bachman was a member of the Wake Forest Demon Deacons for four seasons. As a senior, he caught 37 passes for 541 yards and six touchdowns. Bachman finished his collegiate career with 82 receptions for 1,162 yards and ten touchdowns in 32 games played. Professional career Los Angeles Rams Bachman was signed by the Los Angeles Rams as an undrafted free agent on April 29, 2019. He was waived/injured during final roster cuts on August 31, 2019, and reverted to injured reserve the next day. He was waived by the Rams with an injury settlement on September 5, 2019. New York Giants Bachman was signed to the New York Giants practice squad on November 12, 2019. He signed a reserve/futures contract with the team on December 30, 2019. Bachman was waived during final roster cuts on September 5, 2020, and signed to the practice squad the next day. He was released on September 15, 2020, but he was re-signed to the practice squad on October 5, 2020. Bachman was elevated to the active roster on October 22 and made his NFL debut on that night in a 22–21 loss to the Philadelphia Eagles. He reverted to the practice squad after the game on October 23. He signed a reserve/future contract on January 4, 2021. He was placed on injured reserve on August 31, 2021, and shortly released. On November 3, 2021, Bachman was signed to the practice squad. On December 18, 2021, Bachman was activated from the practice squad as a COVID-19 replacement for the game against the Dallas Cowboys. He signed a reserve/future contract with the Giants on January 11, 2022. On August 30, 2022, Bachman was waived by the Giants. Houston Texans On November 15, 2022, Bachman signed with the practice squad of the Houston Texans. He signed a reserve/future contract on January 10, 2023. He was waived on August 22, 2023. References External links New York Giants bio Wake Forest Demon Deacons bio 1996 births Living people Players of American football from Los Angeles County, California Players of American football from Westlake Village, California American football wide receivers Wake Forest Demon Deacons football players Los Angeles Rams players New York Giants players Houston Texans players Oaks Christian School alumni
```xml import path from "path"; import webpack, { Configuration, WebpackPluginInstance, RuleSetUseItem, } from "webpack"; import { WebpackManifestPlugin } from "webpack-manifest-plugin"; import TerserPlugin from "terser-webpack-plugin"; import MiniCssExtractPlugin from "mini-css-extract-plugin"; import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import LoadablePlugin from "@loadable/webpack-plugin"; import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer"; export const isDev = process.env.NODE_ENV === "development"; const getStyleLoaders = (isWeb: boolean, isSass?: boolean) => { let loaders: RuleSetUseItem[] = [ { loader: "css-loader", options: { importLoaders: isSass ? 2 : 1, modules: { auto: true, localIdentName: isDev ? "[path][name]__[local]" : "[hash:base64]", exportOnlyLocals: !isWeb, }, }, }, { loader: "postcss-loader" }, ]; if (isWeb) loaders = [MiniCssExtractPlugin.loader, ...loaders]; if (isSass) loaders = [...loaders, { loader: "sass-loader" }]; return loaders; }; const getPlugins = (isWeb: boolean) => { let plugins = [ new webpack.ProgressPlugin(), new WebpackManifestPlugin({ fileName: path.resolve(process.cwd(), "public/webpack-assets.json"), filter: (file) => file.isInitial, }), new LoadablePlugin({ writeToDisk: true, filename: "../loadable-stats.json", }), // Setting global variables new webpack.DefinePlugin({ __CLIENT__: isWeb, __SERVER__: !isWeb, __DEV__: isDev, }), ]; if (isDev) plugins = [ ...plugins, // Runs TypeScript type checker on a separate process new ForkTsCheckerWebpackPlugin({ // (Required) Same as eslint command eslint: { files: "./src/**/*.{js,jsx,ts,tsx}" }, }), ]; if (!isDev) plugins = [ ...plugins, // Visualize size of webpack output files, see: path_to_url new BundleAnalyzerPlugin({ analyzerMode: process.env.NODE_ENV === "analyze" ? "server" : "disabled", }), ]; return plugins; }; const config = (isWeb = false): Configuration => ({ mode: isDev ? "development" : "production", stats: "minimal", context: path.resolve(process.cwd()), output: { clean: true }, optimization: { minimizer: [ new TerserPlugin({ // See more options: path_to_url#terseroptions terserOptions: { compress: { drop_console: true } }, }), ], }, plugins: getPlugins(isWeb) as WebpackPluginInstance[], module: { rules: [ { test: /\.(t|j)sx?$/, exclude: /node_modules/, loader: "babel-loader", options: { caller: { target: isWeb ? "web" : "node" }, cacheDirectory: isDev, }, }, { test: /\.css$/, use: getStyleLoaders(isWeb), }, { test: /\.(scss|sass)$/, use: getStyleLoaders(isWeb, true), }, { test: /\.(woff2?|eot|ttf|otf)$/i, type: "asset", generator: { emit: isWeb }, }, { test: /\.(png|svg|jpe?g|gif)$/i, type: "asset", generator: { emit: isWeb }, }, ], }, resolve: { modules: ["src", "node_modules"], extensions: [".ts", ".tsx", ".js", ".jsx", ".json"], }, }); export default config; ```
```c++ // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "client/windows/crash_generation/minidump_generator.h" #include <assert.h> #include <avrfsdk.h> #include <algorithm> #include <iterator> #include <list> #include <vector> #include "client/windows/common/auto_critical_section.h" #include "common/scoped_ptr.h" #include "common/windows/guid_string.h" using std::wstring; namespace { // A helper class used to collect handle operations data. Unlike // |MiniDumpWithHandleData| it records the operations for a single handle value // only, making it possible to include this information to a minidump. class HandleTraceData { public: HandleTraceData(); ~HandleTraceData(); // Collects the handle operations data and formats a user stream to be added // to the minidump. bool CollectHandleData(HANDLE process_handle, EXCEPTION_POINTERS* exception_pointers); // Fills the user dump entry with a pointer to the collected handle operations // data. Returns |true| if the entry was initialized successfully, or |false| // if no trace data is available. bool GetUserStream(MINIDUMP_USER_STREAM* user_stream); private: // Reads the exception code from the client process's address space. // This routine assumes that the client process's pointer width matches ours. static bool ReadExceptionCode(HANDLE process_handle, EXCEPTION_POINTERS* exception_pointers, DWORD* exception_code); // Stores handle operations retrieved by VerifierEnumerateResource(). static ULONG CALLBACK RecordHandleOperations(void* resource_description, void* enumeration_context, ULONG* enumeration_level); // Function pointer type for VerifierEnumerateResource, which is looked up // dynamically. typedef BOOL (WINAPI* VerifierEnumerateResourceType)( HANDLE Process, ULONG Flags, ULONG ResourceType, AVRF_RESOURCE_ENUMERATE_CALLBACK ResourceCallback, PVOID EnumerationContext); // Handle to dynamically loaded verifier.dll. HMODULE verifier_module_; // Pointer to the VerifierEnumerateResource function. VerifierEnumerateResourceType enumerate_resource_; // Handle value to look for. ULONG64 handle_; // List of handle operations for |handle_|. std::list<AVRF_HANDLE_OPERATION> operations_; // Minidump stream data. std::vector<char> stream_; }; HandleTraceData::HandleTraceData() : verifier_module_(NULL), enumerate_resource_(NULL), handle_(NULL) { } HandleTraceData::~HandleTraceData() { if (verifier_module_) { FreeLibrary(verifier_module_); } } bool HandleTraceData::CollectHandleData( HANDLE process_handle, EXCEPTION_POINTERS* exception_pointers) { DWORD exception_code; if (!ReadExceptionCode(process_handle, exception_pointers, &exception_code)) { return false; } // Verify whether the execption is STATUS_INVALID_HANDLE. Do not record any // handle information if it is a different exception to keep the minidump // small. if (exception_code != STATUS_INVALID_HANDLE) { return true; } // Load verifier!VerifierEnumerateResource() dynamically. verifier_module_ = LoadLibrary(TEXT("verifier.dll")); if (!verifier_module_) { return false; } enumerate_resource_ = reinterpret_cast<VerifierEnumerateResourceType>( GetProcAddress(verifier_module_, "VerifierEnumerateResource")); if (!enumerate_resource_) { return false; } // STATUS_INVALID_HANDLE does not provide the offending handle value in // the exception parameters so we have to guess. At the moment we scan // the handle operations trace looking for the last invalid handle operation // and record only the operations for that handle value. if (enumerate_resource_(process_handle, 0, AvrfResourceHandleTrace, &RecordHandleOperations, this) != ERROR_SUCCESS) { // The handle tracing must have not been enabled. return true; } // Now that |handle_| is initialized, purge all irrelevant operations. std::list<AVRF_HANDLE_OPERATION>::iterator i = operations_.begin(); std::list<AVRF_HANDLE_OPERATION>::iterator i_end = operations_.end(); while (i != i_end) { if (i->Handle == handle_) { ++i; } else { i = operations_.erase(i); } } // Convert the list of recorded operations to a minidump stream. stream_.resize(sizeof(MINIDUMP_HANDLE_OPERATION_LIST) + sizeof(AVRF_HANDLE_OPERATION) * operations_.size()); MINIDUMP_HANDLE_OPERATION_LIST* stream_data = reinterpret_cast<MINIDUMP_HANDLE_OPERATION_LIST*>( &stream_.front()); stream_data->SizeOfHeader = sizeof(MINIDUMP_HANDLE_OPERATION_LIST); stream_data->SizeOfEntry = sizeof(AVRF_HANDLE_OPERATION); stream_data->NumberOfEntries = static_cast<ULONG32>(operations_.size()); stream_data->Reserved = 0; std::copy(operations_.begin(), operations_.end(), stdext::checked_array_iterator<AVRF_HANDLE_OPERATION*>( reinterpret_cast<AVRF_HANDLE_OPERATION*>(stream_data + 1), operations_.size())); return true; } bool HandleTraceData::GetUserStream(MINIDUMP_USER_STREAM* user_stream) { if (stream_.empty()) { return false; } else { user_stream->Type = HandleOperationListStream; user_stream->BufferSize = static_cast<ULONG>(stream_.size()); user_stream->Buffer = &stream_.front(); return true; } } bool HandleTraceData::ReadExceptionCode( HANDLE process_handle, EXCEPTION_POINTERS* exception_pointers, DWORD* exception_code) { EXCEPTION_POINTERS pointers; if (!ReadProcessMemory(process_handle, exception_pointers, &pointers, sizeof(pointers), NULL)) { return false; } if (!ReadProcessMemory(process_handle, pointers.ExceptionRecord, exception_code, sizeof(*exception_code), NULL)) { return false; } return true; } ULONG CALLBACK HandleTraceData::RecordHandleOperations( void* resource_description, void* enumeration_context, ULONG* enumeration_level) { AVRF_HANDLE_OPERATION* description = reinterpret_cast<AVRF_HANDLE_OPERATION*>(resource_description); HandleTraceData* self = reinterpret_cast<HandleTraceData*>(enumeration_context); // Remember the last invalid handle operation. if (description->OperationType == OperationDbBADREF) { self->handle_ = description->Handle; } // Record all handle operations. self->operations_.push_back(*description); *enumeration_level = HeapEnumerationEverything; return ERROR_SUCCESS; } } // namespace namespace google_breakpad { MinidumpGenerator::MinidumpGenerator(const wstring& dump_path) : dbghelp_module_(NULL), rpcrt4_module_(NULL), dump_path_(dump_path), write_dump_(NULL), create_uuid_(NULL) { InitializeCriticalSection(&module_load_sync_); InitializeCriticalSection(&get_proc_address_sync_); } MinidumpGenerator::~MinidumpGenerator() { if (dbghelp_module_) { FreeLibrary(dbghelp_module_); } if (rpcrt4_module_) { FreeLibrary(rpcrt4_module_); } DeleteCriticalSection(&get_proc_address_sync_); DeleteCriticalSection(&module_load_sync_); } bool MinidumpGenerator::WriteMinidump(HANDLE process_handle, DWORD process_id, DWORD thread_id, DWORD requesting_thread_id, EXCEPTION_POINTERS* exception_pointers, MDRawAssertionInfo* assert_info, MINIDUMP_TYPE dump_type, bool is_client_pointers, wstring* dump_path) { // Just call the full WriteMinidump with NULL as the full_dump_path. return this->WriteMinidump(process_handle, process_id, thread_id, requesting_thread_id, exception_pointers, assert_info, dump_type, is_client_pointers, dump_path, NULL); } bool MinidumpGenerator::WriteMinidump(HANDLE process_handle, DWORD process_id, DWORD thread_id, DWORD requesting_thread_id, EXCEPTION_POINTERS* exception_pointers, MDRawAssertionInfo* assert_info, MINIDUMP_TYPE dump_type, bool is_client_pointers, wstring* dump_path, wstring* full_dump_path) { wstring dump_file_path; if (!GenerateDumpFilePath(&dump_file_path)) { return false; } // If the client requests a full memory dump, we will write a normal mini // dump and a full memory dump. Both dump files use the same uuid as file // name prefix. bool full_memory_dump = (dump_type & MiniDumpWithFullMemory) != 0; wstring full_dump_file_path; if (full_memory_dump) { full_dump_file_path.assign(dump_file_path); full_dump_file_path.resize(full_dump_file_path.size() - 4); // strip .dmp full_dump_file_path.append(TEXT("-full.dmp")); } HANDLE dump_file = CreateFile(dump_file_path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); if (dump_file == INVALID_HANDLE_VALUE) { return false; } HANDLE full_dump_file = INVALID_HANDLE_VALUE; if (full_memory_dump) { full_dump_file = CreateFile(full_dump_file_path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); if (full_dump_file == INVALID_HANDLE_VALUE) { CloseHandle(dump_file); return false; } } bool result = WriteMinidump(process_handle, process_id, thread_id, requesting_thread_id, exception_pointers, assert_info, dump_type, is_client_pointers, dump_file, full_dump_file); // Store the path of the dump file in the out parameter if dump generation // succeeded. if (result && dump_path) { *dump_path = dump_file_path; } if (result && full_memory_dump && full_dump_path) { *full_dump_path = full_dump_file_path; } CloseHandle(dump_file); if (full_dump_file != INVALID_HANDLE_VALUE) CloseHandle(full_dump_file); return result; } bool MinidumpGenerator::WriteMinidump(HANDLE process_handle, DWORD process_id, DWORD thread_id, DWORD requesting_thread_id, EXCEPTION_POINTERS* exception_pointers, MDRawAssertionInfo* assert_info, MINIDUMP_TYPE dump_type, bool is_client_pointers, HANDLE dump_file, HANDLE full_dump_file) { return WriteMinidump(process_handle, process_id, thread_id, requesting_thread_id, exception_pointers, assert_info, dump_type, is_client_pointers, dump_file, full_dump_file, NULL); } bool MinidumpGenerator::WriteMinidump( HANDLE process_handle, DWORD process_id, DWORD thread_id, DWORD requesting_thread_id, EXCEPTION_POINTERS* exception_pointers, MDRawAssertionInfo* assert_info, MINIDUMP_TYPE dump_type, bool is_client_pointers, HANDLE dump_file, HANDLE full_dump_file, MINIDUMP_USER_STREAM_INFORMATION* additional_streams) { bool full_memory_dump = (dump_type & MiniDumpWithFullMemory) != 0; if (dump_file == INVALID_HANDLE_VALUE || (full_memory_dump && full_dump_file == INVALID_HANDLE_VALUE)) { return false; } MiniDumpWriteDumpType write_dump = GetWriteDump(); if (!write_dump) { return false; } MINIDUMP_EXCEPTION_INFORMATION* dump_exception_pointers = NULL; MINIDUMP_EXCEPTION_INFORMATION dump_exception_info; // Setup the exception information object only if it's a dump // due to an exception. if (exception_pointers) { dump_exception_pointers = &dump_exception_info; dump_exception_info.ThreadId = thread_id; dump_exception_info.ExceptionPointers = exception_pointers; dump_exception_info.ClientPointers = is_client_pointers; } // Add an MDRawBreakpadInfo stream to the minidump, to provide additional // information about the exception handler to the Breakpad processor. // The information will help the processor determine which threads are // relevant. The Breakpad processor does not require this information but // can function better with Breakpad-generated dumps when it is present. // The native debugger is not harmed by the presence of this information. MDRawBreakpadInfo breakpad_info = {0}; if (!is_client_pointers) { // Set the dump thread id and requesting thread id only in case of // in-process dump generation. breakpad_info.validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID | MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID; breakpad_info.dump_thread_id = thread_id; breakpad_info.requesting_thread_id = requesting_thread_id; } int additional_streams_count = additional_streams ? additional_streams->UserStreamCount : 0; scoped_array<MINIDUMP_USER_STREAM> user_stream_array( new MINIDUMP_USER_STREAM[3 + additional_streams_count]); user_stream_array[0].Type = MD_BREAKPAD_INFO_STREAM; user_stream_array[0].BufferSize = sizeof(breakpad_info); user_stream_array[0].Buffer = &breakpad_info; MINIDUMP_USER_STREAM_INFORMATION user_streams; user_streams.UserStreamCount = 1; user_streams.UserStreamArray = user_stream_array.get(); MDRawAssertionInfo* actual_assert_info = assert_info; MDRawAssertionInfo client_assert_info = {0}; if (assert_info) { // If the assertion info object lives in the client process, // read the memory of the client process. if (is_client_pointers) { SIZE_T bytes_read = 0; if (!ReadProcessMemory(process_handle, assert_info, &client_assert_info, sizeof(client_assert_info), &bytes_read)) { CloseHandle(dump_file); if (full_dump_file != INVALID_HANDLE_VALUE) CloseHandle(full_dump_file); return false; } if (bytes_read != sizeof(client_assert_info)) { CloseHandle(dump_file); if (full_dump_file != INVALID_HANDLE_VALUE) CloseHandle(full_dump_file); return false; } actual_assert_info = &client_assert_info; } user_stream_array[1].Type = MD_ASSERTION_INFO_STREAM; user_stream_array[1].BufferSize = sizeof(MDRawAssertionInfo); user_stream_array[1].Buffer = actual_assert_info; ++user_streams.UserStreamCount; } if (additional_streams) { for (size_t i = 0; i < additional_streams->UserStreamCount; i++, user_streams.UserStreamCount++) { user_stream_array[user_streams.UserStreamCount].Type = additional_streams->UserStreamArray[i].Type; user_stream_array[user_streams.UserStreamCount].BufferSize = additional_streams->UserStreamArray[i].BufferSize; user_stream_array[user_streams.UserStreamCount].Buffer = additional_streams->UserStreamArray[i].Buffer; } } // If the process is terminated by STATUS_INVALID_HANDLE exception store // the trace of operations for the offending handle value. Do nothing special // if the client already requested the handle trace to be stored in the dump. HandleTraceData handle_trace_data; if (exception_pointers && (dump_type & MiniDumpWithHandleData) == 0) { if (!handle_trace_data.CollectHandleData(process_handle, exception_pointers)) { CloseHandle(dump_file); if (full_dump_file != INVALID_HANDLE_VALUE) CloseHandle(full_dump_file); return false; } } bool result_full_memory = true; if (full_memory_dump) { result_full_memory = write_dump( process_handle, process_id, full_dump_file, static_cast<MINIDUMP_TYPE>((dump_type & (~MiniDumpNormal)) | MiniDumpWithHandleData), exception_pointers ? &dump_exception_info : NULL, &user_streams, NULL) != FALSE; } // Add handle operations trace stream to the minidump if it was collected. if (handle_trace_data.GetUserStream( &user_stream_array[user_streams.UserStreamCount])) { ++user_streams.UserStreamCount; } bool result_minidump = write_dump( process_handle, process_id, dump_file, static_cast<MINIDUMP_TYPE>((dump_type & (~MiniDumpWithFullMemory)) | MiniDumpNormal), exception_pointers ? &dump_exception_info : NULL, &user_streams, NULL) != FALSE; return result_minidump && result_full_memory; } HMODULE MinidumpGenerator::GetDbghelpModule() { AutoCriticalSection lock(&module_load_sync_); if (!dbghelp_module_) { dbghelp_module_ = LoadLibrary(TEXT("dbghelp.dll")); } return dbghelp_module_; } MinidumpGenerator::MiniDumpWriteDumpType MinidumpGenerator::GetWriteDump() { AutoCriticalSection lock(&get_proc_address_sync_); if (!write_dump_) { HMODULE module = GetDbghelpModule(); if (module) { FARPROC proc = GetProcAddress(module, "MiniDumpWriteDump"); write_dump_ = reinterpret_cast<MiniDumpWriteDumpType>(proc); } } return write_dump_; } HMODULE MinidumpGenerator::GetRpcrt4Module() { AutoCriticalSection lock(&module_load_sync_); if (!rpcrt4_module_) { rpcrt4_module_ = LoadLibrary(TEXT("rpcrt4.dll")); } return rpcrt4_module_; } MinidumpGenerator::UuidCreateType MinidumpGenerator::GetCreateUuid() { AutoCriticalSection lock(&module_load_sync_); if (!create_uuid_) { HMODULE module = GetRpcrt4Module(); if (module) { FARPROC proc = GetProcAddress(module, "UuidCreate"); create_uuid_ = reinterpret_cast<UuidCreateType>(proc); } } return create_uuid_; } bool MinidumpGenerator::GenerateDumpFilePath(wstring* file_path) { UUID id = {0}; UuidCreateType create_uuid = GetCreateUuid(); if (!create_uuid) { return false; } create_uuid(&id); wstring id_str = GUIDString::GUIDToWString(&id); *file_path = dump_path_ + TEXT("\\") + id_str + TEXT(".dmp"); return true; } } // namespace google_breakpad ```