public sealed class CreateKeyRequest : IMessage<CreateKeyRequest>, IEquatable<CreateKeyRequest>, IDeepCloneable<CreateKeyRequest>, IBufferMessage, IMessage
Reference documentation and code samples for the API Keys v2 API class CreateKeyRequest.
User specified key id (optional). If specified, it will become the final
component of the key resource name.
The id must be unique within the project, must conform with RFC-1034,
is restricted to lower-cased letters, and has a maximum length of 63
characters. In another word, the id must match the regular
expression: [a-z]([a-z0-9-]{0,61}[a-z0-9])?.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eCreateKeyRequest\u003c/code\u003e class is used to send a request to create a new API key through the \u003ccode\u003eCreateKey\u003c/code\u003e method in the API Keys v2 API.\u003c/p\u003e\n"],["\u003cp\u003eThis class implements multiple interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, providing functionalities such as deep cloning and protocol buffer message handling.\u003c/p\u003e\n"],["\u003cp\u003eYou can create a \u003ccode\u003eCreateKeyRequest\u003c/code\u003e object either by using a default constructor, \u003ccode\u003eCreateKeyRequest()\u003c/code\u003e, or by providing another existing \u003ccode\u003eCreateKeyRequest\u003c/code\u003e instance to its copy constructor.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCreateKeyRequest\u003c/code\u003e class allows setting the \u003ccode\u003eKey\u003c/code\u003e properties, such as \u003ccode\u003edisplay_name\u003c/code\u003e, \u003ccode\u003erestrictions\u003c/code\u003e, and \u003ccode\u003eannotations\u003c/code\u003e, as well as a user-specified \u003ccode\u003eKeyId\u003c/code\u003e that must adhere to specific naming constraints.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eParent\u003c/code\u003e and \u003ccode\u003eParentAsLocationName\u003c/code\u003e properties are required to specify the project in which the API key will be created, with \u003ccode\u003eParentAsLocationName\u003c/code\u003e offering a typed view of the parent resource name.\u003c/p\u003e\n"]]],[],null,[]]