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\u003eThis documentation is for the \u003ccode\u003eCreateKeyRequest\u003c/code\u003e class within the Google Cloud API Keys v2 API, version 1.3.0, which is a request message type used for creating API keys.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCreateKeyRequest\u003c/code\u003e class inherits from \u003ccode\u003eobject\u003c/code\u003e and 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.\u003c/p\u003e\n"],["\u003cp\u003eThe class offers two constructors: a default constructor, and another that accepts another \u003ccode\u003eCreateKeyRequest\u003c/code\u003e object to copy its properties.\u003c/p\u003e\n"],["\u003cp\u003eIt has properties to set the \u003ccode\u003eKey\u003c/code\u003e itself, the \u003ccode\u003eKeyId\u003c/code\u003e, the \u003ccode\u003eParent\u003c/code\u003e project, and the \u003ccode\u003eParentAsLocationName\u003c/code\u003e which is a \u003ccode\u003eLocationName\u003c/code\u003e representation of the parent resource.\u003c/p\u003e\n"],["\u003cp\u003eThe 'Key' property is required, and at creation time, only the \u003ccode\u003edisplay_name\u003c/code\u003e, \u003ccode\u003erestrictions\u003c/code\u003e, and \u003ccode\u003eannotations\u003c/code\u003e fields are able to be configured.\u003c/p\u003e\n"]]],[],null,[]]