> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/software-delivery-agent-apis/gitops/repository-certificates.md).

# Repository Certificates

## List all available repository certificates

> List repository certificates.

```json
{"openapi":"3.0.0","info":{"title":"Harness NextGen GitOps API Reference","version":"1.0"},"paths":{"/api/v1/agents/{agentIdentifier}/certificates":{"get":{"summary":"List all available repository certificates","description":"List repository certificates.","operationId":"AgentCertificateService_List","responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/certificatesRepositoryCertificateList"}}}},"default":{"description":"An unexpected error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/gatewayruntimeError"}}}}},"parameters":[{"name":"agentIdentifier","description":"Agent identifier for entity.","in":"path","required":true,"schema":{"type":"string"}},{"name":"accountIdentifier","description":"Account Identifier for the Entity.","in":"query","required":false,"schema":{"type":"string"}},{"name":"orgIdentifier","description":"Organization Identifier for the Entity.","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectIdentifier","in":"query","required":false,"schema":{"type":"string"}},{"name":"query.hostNamePattern","description":"A file-glob pattern (not regular expression) the host name has to match.","in":"query","required":false,"schema":{"type":"string"}},{"name":"query.certType","description":"The type of the certificate to match (ssh or https).","in":"query","required":false,"schema":{"type":"string"}},{"name":"query.certSubType","description":"The sub type of the certificate to match (protocol dependent, usually only used for ssh certs).","in":"query","required":false,"schema":{"type":"string"}}],"tags":["Repository Certificates"]}}},"components":{"schemas":{"certificatesRepositoryCertificateList":{"type":"object","properties":{"metadata":{"$ref":"#/components/schemas/v1ListMeta"},"items":{"type":"array","items":{"$ref":"#/components/schemas/certificatesRepositoryCertificate"},"title":"List of certificates to be processed"}},"title":"RepositoryCertificateList is a collection of RepositoryCertificates"},"v1ListMeta":{"type":"object","properties":{"selfLink":{"type":"string","title":"Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.\n+optional"},"resourceVersion":{"type":"string","title":"String that identifies the server's internal version of this object that\ncan be used by clients to determine when objects have changed.\nValue must be treated as opaque by clients and passed unmodified back to the server.\nPopulated by the system.\nRead-only.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency\n+optional"},"continue":{"type":"string","description":"continue may be set if the user set a limit on the number of items returned, and indicates that\nthe server has more data available. The value is opaque and may be used to issue another request\nto the endpoint that served this list to retrieve the next set of available objects. Continuing a\nconsistent list may not be possible if the server configuration has changed or more than a few\nminutes have passed. The resourceVersion field returned when using this continue value will be\nidentical to the value in the first response, unless you have received this token from an error\nmessage."},"remainingItemCount":{"type":"string","format":"int64","title":"remainingItemCount is the number of subsequent items in the list which are not included in this\nlist response. If the list request contained label or field selectors, then the number of\nremaining items is unknown and the field will be left unset and omitted during serialization.\nIf the list is complete (either because it is not chunking or because this is the last chunk),\nthen there are no more remaining items and this field will be left unset and omitted during\nserialization.\nServers older than v1.15 do not set this field.\nThe intended use of the remainingItemCount is *estimating* the size of a collection. Clients\nshould not rely on the remainingItemCount to be set or to be exact.\n+optional"},"shardInfo":{"$ref":"#/components/schemas/v1ShardInfo"}},"description":"ListMeta describes metadata that synthetic resources must have, including lists and\nvarious status objects. A resource may have only one of {ObjectMeta, ListMeta}."},"v1ShardInfo":{"type":"object","properties":{"selector":{"type":"string","title":"selector is the shard selector string from the request, echoed back so clients\ncan verify which shard they received and merge responses from multiple shards.\n+required"}},"description":"ShardInfo describes the shard selector that was applied to produce a list response.\nIts presence on a list response indicates the list is a filtered subset."},"certificatesRepositoryCertificate":{"type":"object","properties":{"serverName":{"type":"string","title":"ServerName specifies the DNS name of the server this certificate is intended for"},"certType":{"type":"string","title":"CertType specifies the type of the certificate - currently one of \"https\" or \"ssh\""},"certSubType":{"type":"string","title":"CertSubType specifies the sub type of the cert, i.e. \"ssh-rsa\""},"certData":{"type":"string","format":"byte","title":"CertData contains the actual certificate data, dependent on the certificate type"},"certInfo":{"type":"string","title":"CertInfo will hold additional certificate info, depdendent on the certificate type (e.g. SSH fingerprint, X509 CommonName)"}},"title":"A RepositoryCertificate is either SSH known hosts entry or TLS certificate"},"gatewayruntimeError":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/protobufAny"}}}},"protobufAny":{"type":"object","properties":{"type_url":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."},"value":{"type":"string","format":"byte","description":"Must be a valid serialized protocol buffer of the above specified type."}},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n\n Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n Example 4: Pack and unpack a message in Go\n\n     foo := &pb.Foo{...}\n     any, err := anypb.New(foo)\n     if err != nil {\n       ...\n     }\n     ...\n     foo := &pb.Foo{}\n     if err := any.UnmarshalTo(foo); err != nil {\n       ...\n     }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"}}}}
```

## Creates repository certificates on the server

> Create repository certificates.

```json
{"openapi":"3.0.0","info":{"title":"Harness NextGen GitOps API Reference","version":"1.0"},"paths":{"/api/v1/agents/{agentIdentifier}/certificates":{"post":{"summary":"Creates repository certificates on the server","description":"Create repository certificates.","operationId":"AgentCertificateService_Create","responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/certificatesRepositoryCertificateList"}}}},"default":{"description":"An unexpected error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/gatewayruntimeError"}}}}},"parameters":[{"name":"agentIdentifier","description":"Agent identifier for entity.","in":"path","required":true,"schema":{"type":"string"}},{"name":"accountIdentifier","description":"Account Identifier for the Entity.","in":"query","required":false,"schema":{"type":"string"}},{"name":"orgIdentifier","description":"Organization Identifier for the Entity.","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectIdentifier","description":"Project Identifier for the Entity.","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/certificatesRepositoryCertificateCreateRequest"}}},"required":true},"tags":["Repository Certificates"]}}},"components":{"schemas":{"certificatesRepositoryCertificateList":{"type":"object","properties":{"metadata":{"$ref":"#/components/schemas/v1ListMeta"},"items":{"type":"array","items":{"$ref":"#/components/schemas/certificatesRepositoryCertificate"},"title":"List of certificates to be processed"}},"title":"RepositoryCertificateList is a collection of RepositoryCertificates"},"v1ListMeta":{"type":"object","properties":{"selfLink":{"type":"string","title":"Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.\n+optional"},"resourceVersion":{"type":"string","title":"String that identifies the server's internal version of this object that\ncan be used by clients to determine when objects have changed.\nValue must be treated as opaque by clients and passed unmodified back to the server.\nPopulated by the system.\nRead-only.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency\n+optional"},"continue":{"type":"string","description":"continue may be set if the user set a limit on the number of items returned, and indicates that\nthe server has more data available. The value is opaque and may be used to issue another request\nto the endpoint that served this list to retrieve the next set of available objects. Continuing a\nconsistent list may not be possible if the server configuration has changed or more than a few\nminutes have passed. The resourceVersion field returned when using this continue value will be\nidentical to the value in the first response, unless you have received this token from an error\nmessage."},"remainingItemCount":{"type":"string","format":"int64","title":"remainingItemCount is the number of subsequent items in the list which are not included in this\nlist response. If the list request contained label or field selectors, then the number of\nremaining items is unknown and the field will be left unset and omitted during serialization.\nIf the list is complete (either because it is not chunking or because this is the last chunk),\nthen there are no more remaining items and this field will be left unset and omitted during\nserialization.\nServers older than v1.15 do not set this field.\nThe intended use of the remainingItemCount is *estimating* the size of a collection. Clients\nshould not rely on the remainingItemCount to be set or to be exact.\n+optional"},"shardInfo":{"$ref":"#/components/schemas/v1ShardInfo"}},"description":"ListMeta describes metadata that synthetic resources must have, including lists and\nvarious status objects. A resource may have only one of {ObjectMeta, ListMeta}."},"v1ShardInfo":{"type":"object","properties":{"selector":{"type":"string","title":"selector is the shard selector string from the request, echoed back so clients\ncan verify which shard they received and merge responses from multiple shards.\n+required"}},"description":"ShardInfo describes the shard selector that was applied to produce a list response.\nIts presence on a list response indicates the list is a filtered subset."},"certificatesRepositoryCertificate":{"type":"object","properties":{"serverName":{"type":"string","title":"ServerName specifies the DNS name of the server this certificate is intended for"},"certType":{"type":"string","title":"CertType specifies the type of the certificate - currently one of \"https\" or \"ssh\""},"certSubType":{"type":"string","title":"CertSubType specifies the sub type of the cert, i.e. \"ssh-rsa\""},"certData":{"type":"string","format":"byte","title":"CertData contains the actual certificate data, dependent on the certificate type"},"certInfo":{"type":"string","title":"CertInfo will hold additional certificate info, depdendent on the certificate type (e.g. SSH fingerprint, X509 CommonName)"}},"title":"A RepositoryCertificate is either SSH known hosts entry or TLS certificate"},"gatewayruntimeError":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/protobufAny"}}}},"protobufAny":{"type":"object","properties":{"type_url":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."},"value":{"type":"string","format":"byte","description":"Must be a valid serialized protocol buffer of the above specified type."}},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n\n Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n Example 4: Pack and unpack a message in Go\n\n     foo := &pb.Foo{...}\n     any, err := anypb.New(foo)\n     if err != nil {\n       ...\n     }\n     ...\n     foo := &pb.Foo{}\n     if err := any.UnmarshalTo(foo); err != nil {\n       ...\n     }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"},"certificatesRepositoryCertificateCreateRequest":{"type":"object","properties":{"certificates":{"$ref":"#/components/schemas/certificatesRepositoryCertificateList"},"upsert":{"type":"boolean","title":"Whether to upsert already existing certificates"}},"title":"Request to create a set of certificates"}}}}
```

## Delete the certificates that match the RepositoryCertificateQuery

> Delete repository certificates.

```json
{"openapi":"3.0.0","info":{"title":"Harness NextGen GitOps API Reference","version":"1.0"},"paths":{"/api/v1/agents/{agentIdentifier}/certificates":{"delete":{"summary":"Delete the certificates that match the RepositoryCertificateQuery","description":"Delete repository certificates.","operationId":"AgentCertificateService_Delete","responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/certificatesRepositoryCertificateList"}}}},"default":{"description":"An unexpected error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/gatewayruntimeError"}}}}},"parameters":[{"name":"agentIdentifier","description":"Agent identifier for entity.","in":"path","required":true,"schema":{"type":"string"}},{"name":"accountIdentifier","description":"Account Identifier for the Entity.","in":"query","required":false,"schema":{"type":"string"}},{"name":"orgIdentifier","description":"Organization Identifier for the Entity.","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectIdentifier","in":"query","required":false,"schema":{"type":"string"}},{"name":"query.hostNamePattern","description":"A file-glob pattern (not regular expression) the host name has to match.","in":"query","required":false,"schema":{"type":"string"}},{"name":"query.certType","description":"The type of the certificate to match (ssh or https).","in":"query","required":false,"schema":{"type":"string"}},{"name":"query.certSubType","description":"The sub type of the certificate to match (protocol dependent, usually only used for ssh certs).","in":"query","required":false,"schema":{"type":"string"}}],"tags":["Repository Certificates"]}}},"components":{"schemas":{"certificatesRepositoryCertificateList":{"type":"object","properties":{"metadata":{"$ref":"#/components/schemas/v1ListMeta"},"items":{"type":"array","items":{"$ref":"#/components/schemas/certificatesRepositoryCertificate"},"title":"List of certificates to be processed"}},"title":"RepositoryCertificateList is a collection of RepositoryCertificates"},"v1ListMeta":{"type":"object","properties":{"selfLink":{"type":"string","title":"Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.\n+optional"},"resourceVersion":{"type":"string","title":"String that identifies the server's internal version of this object that\ncan be used by clients to determine when objects have changed.\nValue must be treated as opaque by clients and passed unmodified back to the server.\nPopulated by the system.\nRead-only.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency\n+optional"},"continue":{"type":"string","description":"continue may be set if the user set a limit on the number of items returned, and indicates that\nthe server has more data available. The value is opaque and may be used to issue another request\nto the endpoint that served this list to retrieve the next set of available objects. Continuing a\nconsistent list may not be possible if the server configuration has changed or more than a few\nminutes have passed. The resourceVersion field returned when using this continue value will be\nidentical to the value in the first response, unless you have received this token from an error\nmessage."},"remainingItemCount":{"type":"string","format":"int64","title":"remainingItemCount is the number of subsequent items in the list which are not included in this\nlist response. If the list request contained label or field selectors, then the number of\nremaining items is unknown and the field will be left unset and omitted during serialization.\nIf the list is complete (either because it is not chunking or because this is the last chunk),\nthen there are no more remaining items and this field will be left unset and omitted during\nserialization.\nServers older than v1.15 do not set this field.\nThe intended use of the remainingItemCount is *estimating* the size of a collection. Clients\nshould not rely on the remainingItemCount to be set or to be exact.\n+optional"},"shardInfo":{"$ref":"#/components/schemas/v1ShardInfo"}},"description":"ListMeta describes metadata that synthetic resources must have, including lists and\nvarious status objects. A resource may have only one of {ObjectMeta, ListMeta}."},"v1ShardInfo":{"type":"object","properties":{"selector":{"type":"string","title":"selector is the shard selector string from the request, echoed back so clients\ncan verify which shard they received and merge responses from multiple shards.\n+required"}},"description":"ShardInfo describes the shard selector that was applied to produce a list response.\nIts presence on a list response indicates the list is a filtered subset."},"certificatesRepositoryCertificate":{"type":"object","properties":{"serverName":{"type":"string","title":"ServerName specifies the DNS name of the server this certificate is intended for"},"certType":{"type":"string","title":"CertType specifies the type of the certificate - currently one of \"https\" or \"ssh\""},"certSubType":{"type":"string","title":"CertSubType specifies the sub type of the cert, i.e. \"ssh-rsa\""},"certData":{"type":"string","format":"byte","title":"CertData contains the actual certificate data, dependent on the certificate type"},"certInfo":{"type":"string","title":"CertInfo will hold additional certificate info, depdendent on the certificate type (e.g. SSH fingerprint, X509 CommonName)"}},"title":"A RepositoryCertificate is either SSH known hosts entry or TLS certificate"},"gatewayruntimeError":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/protobufAny"}}}},"protobufAny":{"type":"object","properties":{"type_url":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."},"value":{"type":"string","format":"byte","description":"Must be a valid serialized protocol buffer of the above specified type."}},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n\n Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n Example 4: Pack and unpack a message in Go\n\n     foo := &pb.Foo{...}\n     any, err := anypb.New(foo)\n     if err != nil {\n       ...\n     }\n     ...\n     foo := &pb.Foo{}\n     if err := any.UnmarshalTo(foo); err != nil {\n       ...\n     }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"}}}}
```
