From ac48a670ffee9052181bbe4ed4ce661f407d2980 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 17:24:14 +0000 Subject: [PATCH] chore(cloudprofiler): update go_package and Go importpath (#9014) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 582685115 Source-Link: https://togithub.com/googleapis/googleapis/commit/c320b40679fccd0e84d328664fa8ce589e62861f Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/8e873fb1b1e209942ab2c1002c0fcfb881f10e59 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGU4NzNmYjFiMWUyMDk5NDJhYjJjMTAwMmMwZmNmYjg4MWYxMGU1OSJ9 --- .release-please-manifest-submodules.json | 1 + cloudprofiler/CHANGES.md | 1 + cloudprofiler/README.md | 55 + cloudprofiler/apiv2/auxiliary.go | 17 + .../apiv2/cloudprofilerpb/profiler.pb.go | 1010 +++++++++++++++++ cloudprofiler/apiv2/doc.go | 125 ++ cloudprofiler/apiv2/gapic_metadata.json | 53 + cloudprofiler/apiv2/profiler_client.go | 603 ++++++++++ .../apiv2/profiler_client_example_test.go | 133 +++ cloudprofiler/apiv2/version.go | 23 + cloudprofiler/go.mod | 31 + cloudprofiler/go.sum | 142 +++ cloudprofiler/internal/version.go | 20 + go.work | 1 + internal/.repo-metadata-full.json | 10 + .../CreateOfflineProfile/main.go | 53 + .../ProfilerClient/CreateProfile/main.go | 53 + .../ProfilerClient/UpdateProfile/main.go | 53 + ...data.google.devtools.cloudprofiler.v2.json | 153 +++ internal/generated/snippets/go.mod | 2 + ...data.google.spanner.admin.database.v1.json | 2 +- ...data.google.spanner.admin.instance.v1.json | 2 +- .../snippet_metadata.google.spanner.v1.json | 2 +- release-please-config-yoshi-submodules.json | 3 + 24 files changed, 2545 insertions(+), 3 deletions(-) create mode 100644 cloudprofiler/CHANGES.md create mode 100644 cloudprofiler/README.md create mode 100755 cloudprofiler/apiv2/auxiliary.go create mode 100755 cloudprofiler/apiv2/cloudprofilerpb/profiler.pb.go create mode 100755 cloudprofiler/apiv2/doc.go create mode 100644 cloudprofiler/apiv2/gapic_metadata.json create mode 100755 cloudprofiler/apiv2/profiler_client.go create mode 100644 cloudprofiler/apiv2/profiler_client_example_test.go create mode 100644 cloudprofiler/apiv2/version.go create mode 100644 cloudprofiler/go.mod create mode 100644 cloudprofiler/go.sum create mode 100644 cloudprofiler/internal/version.go create mode 100644 internal/generated/snippets/cloudprofiler/apiv2/ProfilerClient/CreateOfflineProfile/main.go create mode 100644 internal/generated/snippets/cloudprofiler/apiv2/ProfilerClient/CreateProfile/main.go create mode 100644 internal/generated/snippets/cloudprofiler/apiv2/ProfilerClient/UpdateProfile/main.go create mode 100644 internal/generated/snippets/cloudprofiler/apiv2/snippet_metadata.google.devtools.cloudprofiler.v2.json diff --git a/.release-please-manifest-submodules.json b/.release-please-manifest-submodules.json index ac661916b3a0..671b1d46fdfe 100644 --- a/.release-please-manifest-submodules.json +++ b/.release-please-manifest-submodules.json @@ -25,6 +25,7 @@ "channel": "1.17.3", "cloudbuild": "1.15.0", "clouddms": "1.7.3", + "cloudprofiler": "0.0.0", "cloudtasks": "1.12.4", "commerce": "0.1.3", "compute": "1.23.3", diff --git a/cloudprofiler/CHANGES.md b/cloudprofiler/CHANGES.md new file mode 100644 index 000000000000..b671f0bbcdd2 --- /dev/null +++ b/cloudprofiler/CHANGES.md @@ -0,0 +1 @@ +# Changes diff --git a/cloudprofiler/README.md b/cloudprofiler/README.md new file mode 100644 index 000000000000..d18e8dc6bc34 --- /dev/null +++ b/cloudprofiler/README.md @@ -0,0 +1,55 @@ +# Cloud Profiler API + +[![Go Reference](https://pkg.go.dev/badge/cloud.google.com/go/cloudprofiler.svg)](https://pkg.go.dev/cloud.google.com/go/cloudprofiler) + +Go Client Library for Cloud Profiler API. + +## Install + +```bash +go get cloud.google.com/go/cloudprofiler +``` + +## Stability + +The stability of this module is indicated by SemVer. + +However, a `v1+` module may have breaking changes in two scenarios: + +* Packages with `alpha` or `beta` in the import path +* The GoDoc has an explicit stability disclaimer (for example, for an experimental feature). + +### Which package to use? + +Generated client library surfaces can be found in packages who's import path +ends in `.../apivXXX`. The `XXX` could be something like `1` or `2` in the case +of a stable service backend or may be like `1beta2` or `2beta` in the case of a +more experimental service backend. Because of this fact, a given module can have +multiple clients for different service backends. In these cases it is generally +recommend to use clients with stable service backends, with import suffixes like +`apiv1`, unless you need to use features that are only present in a beta backend +or there is not yet a stable backend available. + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples?l=go). + +## Go Version Support + +See the [Go Versions Supported](https://github.com/googleapis/google-cloud-go#go-versions-supported) +section in the root directory's README. + +## Authorization + +See the [Authorization](https://github.com/googleapis/google-cloud-go#authorization) +section in the root directory's README. + +## Contributing + +Contributions are welcome. Please, see the [CONTRIBUTING](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md) +document for details. + +Please note that this project is released with a Contributor Code of Conduct. +By participating in this project you agree to abide by its terms. See +[Contributor Code of Conduct](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md#contributor-code-of-conduct) +for more information. diff --git a/cloudprofiler/apiv2/auxiliary.go b/cloudprofiler/apiv2/auxiliary.go new file mode 100755 index 000000000000..df6f67759fd7 --- /dev/null +++ b/cloudprofiler/apiv2/auxiliary.go @@ -0,0 +1,17 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package cloudprofiler diff --git a/cloudprofiler/apiv2/cloudprofilerpb/profiler.pb.go b/cloudprofiler/apiv2/cloudprofilerpb/profiler.pb.go new file mode 100755 index 000000000000..692bd27b36e0 --- /dev/null +++ b/cloudprofiler/apiv2/cloudprofilerpb/profiler.pb.go @@ -0,0 +1,1010 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.23.2 +// source: google/devtools/cloudprofiler/v2/profiler.proto + +package cloudprofilerpb + +import ( + context "context" + reflect "reflect" + sync "sync" + + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ProfileType is type of profiling data. +// NOTE: the enumeration member names are used (in lowercase) as unique string +// identifiers of profile types, so they must not be renamed. +type ProfileType int32 + +const ( + // Unspecified profile type. + ProfileType_PROFILE_TYPE_UNSPECIFIED ProfileType = 0 + // Thread CPU time sampling. + ProfileType_CPU ProfileType = 1 + // Wallclock time sampling. More expensive as stops all threads. + ProfileType_WALL ProfileType = 2 + // In-use heap profile. Represents a snapshot of the allocations that are + // live at the time of the profiling. + ProfileType_HEAP ProfileType = 3 + // Single-shot collection of all thread stacks. + ProfileType_THREADS ProfileType = 4 + // Synchronization contention profile. + ProfileType_CONTENTION ProfileType = 5 + // Peak heap profile. + ProfileType_PEAK_HEAP ProfileType = 6 + // Heap allocation profile. It represents the aggregation of all allocations + // made over the duration of the profile. All allocations are included, + // including those that might have been freed by the end of the profiling + // interval. The profile is in particular useful for garbage collecting + // languages to understand which parts of the code create most of the garbage + // collection pressure to see if those can be optimized. + ProfileType_HEAP_ALLOC ProfileType = 7 +) + +// Enum value maps for ProfileType. +var ( + ProfileType_name = map[int32]string{ + 0: "PROFILE_TYPE_UNSPECIFIED", + 1: "CPU", + 2: "WALL", + 3: "HEAP", + 4: "THREADS", + 5: "CONTENTION", + 6: "PEAK_HEAP", + 7: "HEAP_ALLOC", + } + ProfileType_value = map[string]int32{ + "PROFILE_TYPE_UNSPECIFIED": 0, + "CPU": 1, + "WALL": 2, + "HEAP": 3, + "THREADS": 4, + "CONTENTION": 5, + "PEAK_HEAP": 6, + "HEAP_ALLOC": 7, + } +) + +func (x ProfileType) Enum() *ProfileType { + p := new(ProfileType) + *p = x + return p +} + +func (x ProfileType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProfileType) Descriptor() protoreflect.EnumDescriptor { + return file_google_devtools_cloudprofiler_v2_profiler_proto_enumTypes[0].Descriptor() +} + +func (ProfileType) Type() protoreflect.EnumType { + return &file_google_devtools_cloudprofiler_v2_profiler_proto_enumTypes[0] +} + +func (x ProfileType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ProfileType.Descriptor instead. +func (ProfileType) EnumDescriptor() ([]byte, []int) { + return file_google_devtools_cloudprofiler_v2_profiler_proto_rawDescGZIP(), []int{0} +} + +// CreateProfileRequest describes a profile resource online creation request. +// The deployment field must be populated. The profile_type specifies the list +// of profile types supported by the agent. The creation call will hang until a +// profile of one of these types needs to be collected. +type CreateProfileRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Parent project to create the profile in. + Parent string `protobuf:"bytes,4,opt,name=parent,proto3" json:"parent,omitempty"` + // Deployment details. + Deployment *Deployment `protobuf:"bytes,1,opt,name=deployment,proto3" json:"deployment,omitempty"` + // One or more profile types that the agent is capable of providing. + ProfileType []ProfileType `protobuf:"varint,2,rep,packed,name=profile_type,json=profileType,proto3,enum=google.devtools.cloudprofiler.v2.ProfileType" json:"profile_type,omitempty"` +} + +func (x *CreateProfileRequest) Reset() { + *x = CreateProfileRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateProfileRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateProfileRequest) ProtoMessage() {} + +func (x *CreateProfileRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateProfileRequest.ProtoReflect.Descriptor instead. +func (*CreateProfileRequest) Descriptor() ([]byte, []int) { + return file_google_devtools_cloudprofiler_v2_profiler_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateProfileRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *CreateProfileRequest) GetDeployment() *Deployment { + if x != nil { + return x.Deployment + } + return nil +} + +func (x *CreateProfileRequest) GetProfileType() []ProfileType { + if x != nil { + return x.ProfileType + } + return nil +} + +// CreateOfflineProfileRequest describes a profile resource offline creation +// request. +type CreateOfflineProfileRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Parent project to create the profile in. + Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` + // Contents of the profile to create. + Profile *Profile `protobuf:"bytes,2,opt,name=profile,proto3" json:"profile,omitempty"` +} + +func (x *CreateOfflineProfileRequest) Reset() { + *x = CreateOfflineProfileRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateOfflineProfileRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOfflineProfileRequest) ProtoMessage() {} + +func (x *CreateOfflineProfileRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateOfflineProfileRequest.ProtoReflect.Descriptor instead. +func (*CreateOfflineProfileRequest) Descriptor() ([]byte, []int) { + return file_google_devtools_cloudprofiler_v2_profiler_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateOfflineProfileRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *CreateOfflineProfileRequest) GetProfile() *Profile { + if x != nil { + return x.Profile + } + return nil +} + +// UpdateProfileRequest contains the profile to update. +type UpdateProfileRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Profile to update. + Profile *Profile `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"` + // Field mask used to specify the fields to be overwritten. Currently only + // profile_bytes and labels fields are supported by UpdateProfile, so only + // those fields can be specified in the mask. When no mask is provided, all + // fields are overwritten. + UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` +} + +func (x *UpdateProfileRequest) Reset() { + *x = UpdateProfileRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateProfileRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateProfileRequest) ProtoMessage() {} + +func (x *UpdateProfileRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateProfileRequest.ProtoReflect.Descriptor instead. +func (*UpdateProfileRequest) Descriptor() ([]byte, []int) { + return file_google_devtools_cloudprofiler_v2_profiler_proto_rawDescGZIP(), []int{2} +} + +func (x *UpdateProfileRequest) GetProfile() *Profile { + if x != nil { + return x.Profile + } + return nil +} + +func (x *UpdateProfileRequest) GetUpdateMask() *fieldmaskpb.FieldMask { + if x != nil { + return x.UpdateMask + } + return nil +} + +// Profile resource. +type Profile struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Output only. Opaque, server-assigned, unique ID for this profile. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Type of profile. + // For offline mode, this must be specified when creating the profile. For + // online mode it is assigned and returned by the server. + ProfileType ProfileType `protobuf:"varint,2,opt,name=profile_type,json=profileType,proto3,enum=google.devtools.cloudprofiler.v2.ProfileType" json:"profile_type,omitempty"` + // Deployment this profile corresponds to. + Deployment *Deployment `protobuf:"bytes,3,opt,name=deployment,proto3" json:"deployment,omitempty"` + // Duration of the profiling session. + // Input (for the offline mode) or output (for the online mode). + // The field represents requested profiling duration. It may slightly differ + // from the effective profiling duration, which is recorded in the profile + // data, in case the profiling can't be stopped immediately (e.g. in case + // stopping the profiling is handled asynchronously). + Duration *durationpb.Duration `protobuf:"bytes,4,opt,name=duration,proto3" json:"duration,omitempty"` + // Input only. Profile bytes, as a gzip compressed serialized proto, the + // format is https://github.com/google/pprof/blob/master/proto/profile.proto. + ProfileBytes []byte `protobuf:"bytes,5,opt,name=profile_bytes,json=profileBytes,proto3" json:"profile_bytes,omitempty"` + // Input only. Labels associated to this specific profile. These labels will + // get merged with the deployment labels for the final data set. See + // documentation on deployment labels for validation rules and limits. + Labels map[string]string `protobuf:"bytes,6,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Profile) Reset() { + *x = Profile{} + if protoimpl.UnsafeEnabled { + mi := &file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Profile) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Profile) ProtoMessage() {} + +func (x *Profile) ProtoReflect() protoreflect.Message { + mi := &file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Profile.ProtoReflect.Descriptor instead. +func (*Profile) Descriptor() ([]byte, []int) { + return file_google_devtools_cloudprofiler_v2_profiler_proto_rawDescGZIP(), []int{3} +} + +func (x *Profile) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Profile) GetProfileType() ProfileType { + if x != nil { + return x.ProfileType + } + return ProfileType_PROFILE_TYPE_UNSPECIFIED +} + +func (x *Profile) GetDeployment() *Deployment { + if x != nil { + return x.Deployment + } + return nil +} + +func (x *Profile) GetDuration() *durationpb.Duration { + if x != nil { + return x.Duration + } + return nil +} + +func (x *Profile) GetProfileBytes() []byte { + if x != nil { + return x.ProfileBytes + } + return nil +} + +func (x *Profile) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +// Deployment contains the deployment identification information. +type Deployment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Project ID is the ID of a cloud project. + // Validation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + // Target is the service name used to group related deployments: + // * Service name for App Engine Flex / Standard. + // * Cluster and container name for GKE. + // * User-specified string for direct Compute Engine profiling (e.g. Java). + // * Job name for Dataflow. + // Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`. + Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` + // Labels identify the deployment within the user universe and same target. + // Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + // Value for an individual label must be <= 512 bytes, the total + // size of all label names and values must be <= 1024 bytes. + // + // Label named "language" can be used to record the programming language of + // the profiled deployment. The standard choices for the value include "java", + // "go", "python", "ruby", "nodejs", "php", "dotnet". + // + // For deployments running on Google Cloud Platform, "zone" or "region" label + // should be present describing the deployment location. An example of a zone + // is "us-central1-a", an example of a region is "us-central1" or + // "us-central". + Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Deployment) Reset() { + *x = Deployment{} + if protoimpl.UnsafeEnabled { + mi := &file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Deployment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Deployment) ProtoMessage() {} + +func (x *Deployment) ProtoReflect() protoreflect.Message { + mi := &file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Deployment.ProtoReflect.Descriptor instead. +func (*Deployment) Descriptor() ([]byte, []int) { + return file_google_devtools_cloudprofiler_v2_profiler_proto_rawDescGZIP(), []int{4} +} + +func (x *Deployment) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *Deployment) GetTarget() string { + if x != nil { + return x.Target + } + return "" +} + +func (x *Deployment) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +var File_google_devtools_cloudprofiler_v2_profiler_proto protoreflect.FileDescriptor + +var file_google_devtools_cloudprofiler_v2_profiler_proto_rawDesc = []byte{ + 0x0a, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x64, 0x65, 0x76, 0x74, 0x6f, 0x6f, 0x6c, + 0x73, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x2f, + 0x76, 0x32, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x74, 0x6f, 0x6f, + 0x6c, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, + 0x2e, 0x76, 0x32, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, + 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, + 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x02, 0x0a, 0x14, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x48, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x30, 0xfa, 0x41, 0x2d, 0x0a, 0x2b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x4c, 0x0a, 0x0a, 0x64, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x74, 0x6f, 0x6f, 0x6c, + 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x2e, + 0x76, 0x32, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x64, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x50, 0x0a, 0x0c, 0x70, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, + 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x74, 0x6f, 0x6f, 0x6c, + 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x2e, + 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0xac, 0x01, 0x0a, 0x1b, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x06, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xfa, 0x41, 0x2d, + 0x0a, 0x2b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, + 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x06, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x43, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x64, 0x65, 0x76, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x98, 0x01, 0x0a, 0x14, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, + 0x76, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, + 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x84, 0x04, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0c, 0x70, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x74, 0x6f, 0x6f, + 0x6c, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, + 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x4c, 0x0a, 0x0a, + 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x74, 0x6f, 0x6f, + 0x6c, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, + 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, + 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x28, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x04, 0x52, 0x0c, 0x70, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x06, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x04, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, + 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x50, 0xea, 0x41, 0x4d, 0x0a, + 0x24, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x25, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, + 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x7d, 0x22, 0xd0, 0x01, 0x0a, + 0x0a, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x12, 0x50, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x74, + 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, + 0x84, 0x01, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x4c, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, + 0x03, 0x43, 0x50, 0x55, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x57, 0x41, 0x4c, 0x4c, 0x10, 0x02, + 0x12, 0x08, 0x0a, 0x04, 0x48, 0x45, 0x41, 0x50, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x48, + 0x52, 0x45, 0x41, 0x44, 0x53, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x4f, 0x4e, 0x54, 0x45, + 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x45, 0x41, 0x4b, 0x5f, + 0x48, 0x45, 0x41, 0x50, 0x10, 0x06, 0x12, 0x0e, 0x0a, 0x0a, 0x48, 0x45, 0x41, 0x50, 0x5f, 0x41, + 0x4c, 0x4c, 0x4f, 0x43, 0x10, 0x07, 0x32, 0xfe, 0x05, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x9f, 0x01, 0x0a, 0x0d, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x36, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, + 0x76, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, + 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x32, 0x2f, + 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, + 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0xd2, 0x01, 0x0a, + 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x3d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, + 0x65, 0x76, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, + 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, + 0x76, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, + 0x50, 0xda, 0x41, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x3a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x22, 0x2e, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x73, 0x3a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, + 0x65, 0x12, 0xc3, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x12, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, 0x76, + 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x4f, 0xda, 0x41, 0x13, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x32, 0x28, 0x2f, + 0x76, 0x32, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, + 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x1a, 0xad, 0x01, 0xca, 0x41, 0x1c, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x8a, 0x01, 0x68, 0x74, 0x74, + 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, + 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x68, 0x74, 0x74, 0x70, + 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, + 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, + 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, + 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, + 0x67, 0x2e, 0x77, 0x72, 0x69, 0x74, 0x65, 0x42, 0xd4, 0x01, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x76, 0x32, + 0x42, 0x0d, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x47, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x70, 0x62, 0x3b, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x70, 0x62, 0xaa, 0x02, 0x18, 0x47, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x72, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x18, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, + 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x5c, 0x56, 0x32, + 0xea, 0x02, 0x1b, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_google_devtools_cloudprofiler_v2_profiler_proto_rawDescOnce sync.Once + file_google_devtools_cloudprofiler_v2_profiler_proto_rawDescData = file_google_devtools_cloudprofiler_v2_profiler_proto_rawDesc +) + +func file_google_devtools_cloudprofiler_v2_profiler_proto_rawDescGZIP() []byte { + file_google_devtools_cloudprofiler_v2_profiler_proto_rawDescOnce.Do(func() { + file_google_devtools_cloudprofiler_v2_profiler_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_devtools_cloudprofiler_v2_profiler_proto_rawDescData) + }) + return file_google_devtools_cloudprofiler_v2_profiler_proto_rawDescData +} + +var file_google_devtools_cloudprofiler_v2_profiler_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_google_devtools_cloudprofiler_v2_profiler_proto_goTypes = []interface{}{ + (ProfileType)(0), // 0: google.devtools.cloudprofiler.v2.ProfileType + (*CreateProfileRequest)(nil), // 1: google.devtools.cloudprofiler.v2.CreateProfileRequest + (*CreateOfflineProfileRequest)(nil), // 2: google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest + (*UpdateProfileRequest)(nil), // 3: google.devtools.cloudprofiler.v2.UpdateProfileRequest + (*Profile)(nil), // 4: google.devtools.cloudprofiler.v2.Profile + (*Deployment)(nil), // 5: google.devtools.cloudprofiler.v2.Deployment + nil, // 6: google.devtools.cloudprofiler.v2.Profile.LabelsEntry + nil, // 7: google.devtools.cloudprofiler.v2.Deployment.LabelsEntry + (*fieldmaskpb.FieldMask)(nil), // 8: google.protobuf.FieldMask + (*durationpb.Duration)(nil), // 9: google.protobuf.Duration +} +var file_google_devtools_cloudprofiler_v2_profiler_proto_depIdxs = []int32{ + 5, // 0: google.devtools.cloudprofiler.v2.CreateProfileRequest.deployment:type_name -> google.devtools.cloudprofiler.v2.Deployment + 0, // 1: google.devtools.cloudprofiler.v2.CreateProfileRequest.profile_type:type_name -> google.devtools.cloudprofiler.v2.ProfileType + 4, // 2: google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest.profile:type_name -> google.devtools.cloudprofiler.v2.Profile + 4, // 3: google.devtools.cloudprofiler.v2.UpdateProfileRequest.profile:type_name -> google.devtools.cloudprofiler.v2.Profile + 8, // 4: google.devtools.cloudprofiler.v2.UpdateProfileRequest.update_mask:type_name -> google.protobuf.FieldMask + 0, // 5: google.devtools.cloudprofiler.v2.Profile.profile_type:type_name -> google.devtools.cloudprofiler.v2.ProfileType + 5, // 6: google.devtools.cloudprofiler.v2.Profile.deployment:type_name -> google.devtools.cloudprofiler.v2.Deployment + 9, // 7: google.devtools.cloudprofiler.v2.Profile.duration:type_name -> google.protobuf.Duration + 6, // 8: google.devtools.cloudprofiler.v2.Profile.labels:type_name -> google.devtools.cloudprofiler.v2.Profile.LabelsEntry + 7, // 9: google.devtools.cloudprofiler.v2.Deployment.labels:type_name -> google.devtools.cloudprofiler.v2.Deployment.LabelsEntry + 1, // 10: google.devtools.cloudprofiler.v2.ProfilerService.CreateProfile:input_type -> google.devtools.cloudprofiler.v2.CreateProfileRequest + 2, // 11: google.devtools.cloudprofiler.v2.ProfilerService.CreateOfflineProfile:input_type -> google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest + 3, // 12: google.devtools.cloudprofiler.v2.ProfilerService.UpdateProfile:input_type -> google.devtools.cloudprofiler.v2.UpdateProfileRequest + 4, // 13: google.devtools.cloudprofiler.v2.ProfilerService.CreateProfile:output_type -> google.devtools.cloudprofiler.v2.Profile + 4, // 14: google.devtools.cloudprofiler.v2.ProfilerService.CreateOfflineProfile:output_type -> google.devtools.cloudprofiler.v2.Profile + 4, // 15: google.devtools.cloudprofiler.v2.ProfilerService.UpdateProfile:output_type -> google.devtools.cloudprofiler.v2.Profile + 13, // [13:16] is the sub-list for method output_type + 10, // [10:13] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_google_devtools_cloudprofiler_v2_profiler_proto_init() } +func file_google_devtools_cloudprofiler_v2_profiler_proto_init() { + if File_google_devtools_cloudprofiler_v2_profiler_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateProfileRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateOfflineProfileRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateProfileRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Profile); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Deployment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_google_devtools_cloudprofiler_v2_profiler_proto_rawDesc, + NumEnums: 1, + NumMessages: 7, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_google_devtools_cloudprofiler_v2_profiler_proto_goTypes, + DependencyIndexes: file_google_devtools_cloudprofiler_v2_profiler_proto_depIdxs, + EnumInfos: file_google_devtools_cloudprofiler_v2_profiler_proto_enumTypes, + MessageInfos: file_google_devtools_cloudprofiler_v2_profiler_proto_msgTypes, + }.Build() + File_google_devtools_cloudprofiler_v2_profiler_proto = out.File + file_google_devtools_cloudprofiler_v2_profiler_proto_rawDesc = nil + file_google_devtools_cloudprofiler_v2_profiler_proto_goTypes = nil + file_google_devtools_cloudprofiler_v2_profiler_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// ProfilerServiceClient is the client API for ProfilerService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ProfilerServiceClient interface { + // CreateProfile creates a new profile resource in the online mode. + // + // The server ensures that the new profiles are created at a constant rate per + // deployment, so the creation request may hang for some time until the next + // profile session is available. + // + // The request may fail with ABORTED error if the creation is not available + // within ~1m, the response will indicate the duration of the backoff the + // client should take before attempting creating a profile again. The backoff + // duration is returned in google.rpc.RetryInfo extension on the response + // status. To a gRPC client, the extension will be return as a + // binary-serialized proto in the trailing metadata item named + // "google.rpc.retryinfo-bin". + // + CreateProfile(ctx context.Context, in *CreateProfileRequest, opts ...grpc.CallOption) (*Profile, error) + // CreateOfflineProfile creates a new profile resource in the offline mode. + // The client provides the profile to create along with the profile bytes, the + // server records it. + CreateOfflineProfile(ctx context.Context, in *CreateOfflineProfileRequest, opts ...grpc.CallOption) (*Profile, error) + // UpdateProfile updates the profile bytes and labels on the profile resource + // created in the online mode. Updating the bytes for profiles created in the + // offline mode is currently not supported: the profile content must be + // provided at the time of the profile creation. + UpdateProfile(ctx context.Context, in *UpdateProfileRequest, opts ...grpc.CallOption) (*Profile, error) +} + +type profilerServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewProfilerServiceClient(cc grpc.ClientConnInterface) ProfilerServiceClient { + return &profilerServiceClient{cc} +} + +func (c *profilerServiceClient) CreateProfile(ctx context.Context, in *CreateProfileRequest, opts ...grpc.CallOption) (*Profile, error) { + out := new(Profile) + err := c.cc.Invoke(ctx, "/google.devtools.cloudprofiler.v2.ProfilerService/CreateProfile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *profilerServiceClient) CreateOfflineProfile(ctx context.Context, in *CreateOfflineProfileRequest, opts ...grpc.CallOption) (*Profile, error) { + out := new(Profile) + err := c.cc.Invoke(ctx, "/google.devtools.cloudprofiler.v2.ProfilerService/CreateOfflineProfile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *profilerServiceClient) UpdateProfile(ctx context.Context, in *UpdateProfileRequest, opts ...grpc.CallOption) (*Profile, error) { + out := new(Profile) + err := c.cc.Invoke(ctx, "/google.devtools.cloudprofiler.v2.ProfilerService/UpdateProfile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ProfilerServiceServer is the server API for ProfilerService service. +type ProfilerServiceServer interface { + // CreateProfile creates a new profile resource in the online mode. + // + // The server ensures that the new profiles are created at a constant rate per + // deployment, so the creation request may hang for some time until the next + // profile session is available. + // + // The request may fail with ABORTED error if the creation is not available + // within ~1m, the response will indicate the duration of the backoff the + // client should take before attempting creating a profile again. The backoff + // duration is returned in google.rpc.RetryInfo extension on the response + // status. To a gRPC client, the extension will be return as a + // binary-serialized proto in the trailing metadata item named + // "google.rpc.retryinfo-bin". + // + CreateProfile(context.Context, *CreateProfileRequest) (*Profile, error) + // CreateOfflineProfile creates a new profile resource in the offline mode. + // The client provides the profile to create along with the profile bytes, the + // server records it. + CreateOfflineProfile(context.Context, *CreateOfflineProfileRequest) (*Profile, error) + // UpdateProfile updates the profile bytes and labels on the profile resource + // created in the online mode. Updating the bytes for profiles created in the + // offline mode is currently not supported: the profile content must be + // provided at the time of the profile creation. + UpdateProfile(context.Context, *UpdateProfileRequest) (*Profile, error) +} + +// UnimplementedProfilerServiceServer can be embedded to have forward compatible implementations. +type UnimplementedProfilerServiceServer struct { +} + +func (*UnimplementedProfilerServiceServer) CreateProfile(context.Context, *CreateProfileRequest) (*Profile, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateProfile not implemented") +} +func (*UnimplementedProfilerServiceServer) CreateOfflineProfile(context.Context, *CreateOfflineProfileRequest) (*Profile, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateOfflineProfile not implemented") +} +func (*UnimplementedProfilerServiceServer) UpdateProfile(context.Context, *UpdateProfileRequest) (*Profile, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateProfile not implemented") +} + +func RegisterProfilerServiceServer(s *grpc.Server, srv ProfilerServiceServer) { + s.RegisterService(&_ProfilerService_serviceDesc, srv) +} + +func _ProfilerService_CreateProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProfilerServiceServer).CreateProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudprofiler.v2.ProfilerService/CreateProfile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProfilerServiceServer).CreateProfile(ctx, req.(*CreateProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ProfilerService_CreateOfflineProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateOfflineProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProfilerServiceServer).CreateOfflineProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudprofiler.v2.ProfilerService/CreateOfflineProfile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProfilerServiceServer).CreateOfflineProfile(ctx, req.(*CreateOfflineProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ProfilerService_UpdateProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProfilerServiceServer).UpdateProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudprofiler.v2.ProfilerService/UpdateProfile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProfilerServiceServer).UpdateProfile(ctx, req.(*UpdateProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ProfilerService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.cloudprofiler.v2.ProfilerService", + HandlerType: (*ProfilerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateProfile", + Handler: _ProfilerService_CreateProfile_Handler, + }, + { + MethodName: "CreateOfflineProfile", + Handler: _ProfilerService_CreateOfflineProfile_Handler, + }, + { + MethodName: "UpdateProfile", + Handler: _ProfilerService_UpdateProfile_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/devtools/cloudprofiler/v2/profiler.proto", +} diff --git a/cloudprofiler/apiv2/doc.go b/cloudprofiler/apiv2/doc.go new file mode 100755 index 000000000000..630e2855cdd9 --- /dev/null +++ b/cloudprofiler/apiv2/doc.go @@ -0,0 +1,125 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +// Package cloudprofiler is an auto-generated package for the +// Cloud Profiler API. +// +// Manages continuous profiling information. +// +// NOTE: This package is in beta. It is not stable, and may be subject to changes. +// +// # General documentation +// +// For information that is relevant for all client libraries please reference +// https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this +// page includes: +// +// - [Authentication and Authorization] +// - [Timeouts and Cancellation] +// - [Testing against Client Libraries] +// - [Debugging Client Libraries] +// - [Inspecting errors] +// +// # Example usage +// +// To get started with this package, create a client. +// +// ctx := context.Background() +// // This snippet has been automatically generated and should be regarded as a code template only. +// // It will require modifications to work: +// // - It may require correct/in-range values for request initialization. +// // - It may require specifying regional endpoints when creating the service client as shown in: +// // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options +// c, err := cloudprofiler.NewProfilerClient(ctx) +// if err != nil { +// // TODO: Handle error. +// } +// defer c.Close() +// +// The client will use your default application credentials. Clients should be reused instead of created as needed. +// The methods of Client are safe for concurrent use by multiple goroutines. +// The returned client must be Closed when it is done being used. +// +// # Using the Client +// +// The following is an example of making an API call with the newly created client. +// +// ctx := context.Background() +// // This snippet has been automatically generated and should be regarded as a code template only. +// // It will require modifications to work: +// // - It may require correct/in-range values for request initialization. +// // - It may require specifying regional endpoints when creating the service client as shown in: +// // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options +// c, err := cloudprofiler.NewProfilerClient(ctx) +// if err != nil { +// // TODO: Handle error. +// } +// defer c.Close() +// +// req := &cloudprofilerpb.CreateOfflineProfileRequest{ +// // TODO: Fill request struct fields. +// // See https://pkg.go.dev/cloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb#CreateOfflineProfileRequest. +// } +// resp, err := c.CreateOfflineProfile(ctx, req) +// if err != nil { +// // TODO: Handle error. +// } +// // TODO: Use resp. +// _ = resp +// +// # Use of Context +// +// The ctx passed to NewProfilerClient is used for authentication requests and +// for creating the underlying connection, but is not used for subsequent calls. +// Individual methods on the client use the ctx given to them. +// +// To close the open connection, use the Close() method. +// +// [Authentication and Authorization]: https://pkg.go.dev/cloud.google.com/go#hdr-Authentication_and_Authorization +// [Timeouts and Cancellation]: https://pkg.go.dev/cloud.google.com/go#hdr-Timeouts_and_Cancellation +// [Testing against Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Testing +// [Debugging Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Debugging +// [Inspecting errors]: https://pkg.go.dev/cloud.google.com/go#hdr-Inspecting_errors +package cloudprofiler // import "cloud.google.com/go/cloudprofiler/apiv2" + +import ( + "context" + + "google.golang.org/api/option" +) + +// For more information on implementing a client constructor hook, see +// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. +type clientHookParams struct{} +type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) + +var versionClient string + +func getVersionClient() string { + if versionClient == "" { + return "UNKNOWN" + } + return versionClient +} + +// DefaultAuthScopes reports the default set of authentication scopes to use with this package. +func DefaultAuthScopes() []string { + return []string{ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/monitoring.write", + } +} diff --git a/cloudprofiler/apiv2/gapic_metadata.json b/cloudprofiler/apiv2/gapic_metadata.json new file mode 100644 index 000000000000..a1cb9dc272ce --- /dev/null +++ b/cloudprofiler/apiv2/gapic_metadata.json @@ -0,0 +1,53 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.", + "language": "go", + "protoPackage": "google.devtools.cloudprofiler.v2", + "libraryPackage": "cloud.google.com/go/cloudprofiler/apiv2", + "services": { + "ProfilerService": { + "clients": { + "grpc": { + "libraryClient": "ProfilerClient", + "rpcs": { + "CreateOfflineProfile": { + "methods": [ + "CreateOfflineProfile" + ] + }, + "CreateProfile": { + "methods": [ + "CreateProfile" + ] + }, + "UpdateProfile": { + "methods": [ + "UpdateProfile" + ] + } + } + }, + "rest": { + "libraryClient": "ProfilerClient", + "rpcs": { + "CreateOfflineProfile": { + "methods": [ + "CreateOfflineProfile" + ] + }, + "CreateProfile": { + "methods": [ + "CreateProfile" + ] + }, + "UpdateProfile": { + "methods": [ + "UpdateProfile" + ] + } + } + } + } + } + } +} diff --git a/cloudprofiler/apiv2/profiler_client.go b/cloudprofiler/apiv2/profiler_client.go new file mode 100755 index 000000000000..0160352657da --- /dev/null +++ b/cloudprofiler/apiv2/profiler_client.go @@ -0,0 +1,603 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package cloudprofiler + +import ( + "bytes" + "context" + "fmt" + "io" + "math" + "net/http" + "net/url" + "time" + + cloudprofilerpb "cloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb" + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/googleapi" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + httptransport "google.golang.org/api/transport/http" + "google.golang.org/grpc" + "google.golang.org/protobuf/encoding/protojson" +) + +var newProfilerClientHook clientHook + +// ProfilerCallOptions contains the retry settings for each method of ProfilerClient. +type ProfilerCallOptions struct { + CreateProfile []gax.CallOption + CreateOfflineProfile []gax.CallOption + UpdateProfile []gax.CallOption +} + +func defaultProfilerGRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("cloudprofiler.googleapis.com:443"), + internaloption.WithDefaultMTLSEndpoint("cloudprofiler.mtls.googleapis.com:443"), + internaloption.WithDefaultAudience("https://cloudprofiler.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultProfilerCallOptions() *ProfilerCallOptions { + return &ProfilerCallOptions{ + CreateProfile: []gax.CallOption{ + gax.WithTimeout(3610000 * time.Millisecond), + }, + CreateOfflineProfile: []gax.CallOption{ + gax.WithTimeout(30000 * time.Millisecond), + }, + UpdateProfile: []gax.CallOption{ + gax.WithTimeout(30000 * time.Millisecond), + }, + } +} + +func defaultProfilerRESTCallOptions() *ProfilerCallOptions { + return &ProfilerCallOptions{ + CreateProfile: []gax.CallOption{ + gax.WithTimeout(3610000 * time.Millisecond), + }, + CreateOfflineProfile: []gax.CallOption{ + gax.WithTimeout(30000 * time.Millisecond), + }, + UpdateProfile: []gax.CallOption{ + gax.WithTimeout(30000 * time.Millisecond), + }, + } +} + +// internalProfilerClient is an interface that defines the methods available from Cloud Profiler API. +type internalProfilerClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + CreateProfile(context.Context, *cloudprofilerpb.CreateProfileRequest, ...gax.CallOption) (*cloudprofilerpb.Profile, error) + CreateOfflineProfile(context.Context, *cloudprofilerpb.CreateOfflineProfileRequest, ...gax.CallOption) (*cloudprofilerpb.Profile, error) + UpdateProfile(context.Context, *cloudprofilerpb.UpdateProfileRequest, ...gax.CallOption) (*cloudprofilerpb.Profile, error) +} + +// ProfilerClient is a client for interacting with Cloud Profiler API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// Manage the collection of continuous profiling data provided by profiling +// agents running in the cloud or by an offline provider of profiling data. +// +// General guidelines: +// +// Profiles for a single deployment must be created in ascending time order. +// +// Profiles can be created in either online or offline mode, see below. +type ProfilerClient struct { + // The internal transport-dependent client. + internalClient internalProfilerClient + + // The call options for this service. + CallOptions *ProfilerCallOptions +} + +// Wrapper methods routed to the internal client. + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *ProfilerClient) Close() error { + return c.internalClient.Close() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *ProfilerClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated: Connections are now pooled so this method does not always +// return the same resource. +func (c *ProfilerClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// CreateProfile createProfile creates a new profile resource in the online mode. +// +// The server ensures that the new profiles are created at a constant rate per +// deployment, so the creation request may hang for some time until the next +// profile session is available. +// +// The request may fail with ABORTED error if the creation is not available +// within ~1m, the response will indicate the duration of the backoff the +// client should take before attempting creating a profile again. The backoff +// duration is returned in google.rpc.RetryInfo extension on the response +// status. To a gRPC client, the extension will be return as a +// binary-serialized proto in the trailing metadata item named +// “google.rpc.retryinfo-bin”. +func (c *ProfilerClient) CreateProfile(ctx context.Context, req *cloudprofilerpb.CreateProfileRequest, opts ...gax.CallOption) (*cloudprofilerpb.Profile, error) { + return c.internalClient.CreateProfile(ctx, req, opts...) +} + +// CreateOfflineProfile createOfflineProfile creates a new profile resource in the offline mode. +// The client provides the profile to create along with the profile bytes, the +// server records it. +func (c *ProfilerClient) CreateOfflineProfile(ctx context.Context, req *cloudprofilerpb.CreateOfflineProfileRequest, opts ...gax.CallOption) (*cloudprofilerpb.Profile, error) { + return c.internalClient.CreateOfflineProfile(ctx, req, opts...) +} + +// UpdateProfile updateProfile updates the profile bytes and labels on the profile resource +// created in the online mode. Updating the bytes for profiles created in the +// offline mode is currently not supported: the profile content must be +// provided at the time of the profile creation. +func (c *ProfilerClient) UpdateProfile(ctx context.Context, req *cloudprofilerpb.UpdateProfileRequest, opts ...gax.CallOption) (*cloudprofilerpb.Profile, error) { + return c.internalClient.UpdateProfile(ctx, req, opts...) +} + +// profilerGRPCClient is a client for interacting with Cloud Profiler API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type profilerGRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // Points back to the CallOptions field of the containing ProfilerClient + CallOptions **ProfilerCallOptions + + // The gRPC API client. + profilerClient cloudprofilerpb.ProfilerServiceClient + + // The x-goog-* metadata to be sent with each request. + xGoogHeaders []string +} + +// NewProfilerClient creates a new profiler service client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// Manage the collection of continuous profiling data provided by profiling +// agents running in the cloud or by an offline provider of profiling data. +// +// General guidelines: +// +// Profiles for a single deployment must be created in ascending time order. +// +// Profiles can be created in either online or offline mode, see below. +func NewProfilerClient(ctx context.Context, opts ...option.ClientOption) (*ProfilerClient, error) { + clientOpts := defaultProfilerGRPCClientOptions() + if newProfilerClientHook != nil { + hookOpts, err := newProfilerClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := ProfilerClient{CallOptions: defaultProfilerCallOptions()} + + c := &profilerGRPCClient{ + connPool: connPool, + profilerClient: cloudprofilerpb.NewProfilerServiceClient(connPool), + CallOptions: &client.CallOptions, + } + c.setGoogleClientInfo() + + client.internalClient = c + + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated: Connections are now pooled so this method does not always +// return the same resource. +func (c *profilerGRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *profilerGRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", gax.GoVersion}, keyval...) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)} +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *profilerGRPCClient) Close() error { + return c.connPool.Close() +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type profilerRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* headers to be sent with each request. + xGoogHeaders []string + + // Points back to the CallOptions field of the containing ProfilerClient + CallOptions **ProfilerCallOptions +} + +// NewProfilerRESTClient creates a new profiler service rest client. +// +// Manage the collection of continuous profiling data provided by profiling +// agents running in the cloud or by an offline provider of profiling data. +// +// General guidelines: +// +// Profiles for a single deployment must be created in ascending time order. +// +// Profiles can be created in either online or offline mode, see below. +func NewProfilerRESTClient(ctx context.Context, opts ...option.ClientOption) (*ProfilerClient, error) { + clientOpts := append(defaultProfilerRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + callOpts := defaultProfilerRESTCallOptions() + c := &profilerRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + CallOptions: &callOpts, + } + c.setGoogleClientInfo() + + return &ProfilerClient{internalClient: c, CallOptions: callOpts}, nil +} + +func defaultProfilerRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("https://cloudprofiler.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("https://cloudprofiler.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://cloudprofiler.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *profilerRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", gax.GoVersion}, keyval...) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)} +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *profilerRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated: This method always returns nil. +func (c *profilerRESTClient) Connection() *grpc.ClientConn { + return nil +} +func (c *profilerGRPCClient) CreateProfile(ctx context.Context, req *cloudprofilerpb.CreateProfileRequest, opts ...gax.CallOption) (*cloudprofilerpb.Profile, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).CreateProfile[0:len((*c.CallOptions).CreateProfile):len((*c.CallOptions).CreateProfile)], opts...) + var resp *cloudprofilerpb.Profile + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.profilerClient.CreateProfile(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *profilerGRPCClient) CreateOfflineProfile(ctx context.Context, req *cloudprofilerpb.CreateOfflineProfileRequest, opts ...gax.CallOption) (*cloudprofilerpb.Profile, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).CreateOfflineProfile[0:len((*c.CallOptions).CreateOfflineProfile):len((*c.CallOptions).CreateOfflineProfile)], opts...) + var resp *cloudprofilerpb.Profile + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.profilerClient.CreateOfflineProfile(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *profilerGRPCClient) UpdateProfile(ctx context.Context, req *cloudprofilerpb.UpdateProfileRequest, opts ...gax.CallOption) (*cloudprofilerpb.Profile, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "profile.name", url.QueryEscape(req.GetProfile().GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).UpdateProfile[0:len((*c.CallOptions).UpdateProfile):len((*c.CallOptions).UpdateProfile)], opts...) + var resp *cloudprofilerpb.Profile + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.profilerClient.UpdateProfile(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +// CreateProfile createProfile creates a new profile resource in the online mode. +// +// The server ensures that the new profiles are created at a constant rate per +// deployment, so the creation request may hang for some time until the next +// profile session is available. +// +// The request may fail with ABORTED error if the creation is not available +// within ~1m, the response will indicate the duration of the backoff the +// client should take before attempting creating a profile again. The backoff +// duration is returned in google.rpc.RetryInfo extension on the response +// status. To a gRPC client, the extension will be return as a +// binary-serialized proto in the trailing metadata item named +// “google.rpc.retryinfo-bin”. +func (c *profilerRESTClient) CreateProfile(ctx context.Context, req *cloudprofilerpb.CreateProfileRequest, opts ...gax.CallOption) (*cloudprofilerpb.Profile, error) { + m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v2/%v/profiles", req.GetParent()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).CreateProfile[0:len((*c.CallOptions).CreateProfile):len((*c.CallOptions).CreateProfile)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &cloudprofilerpb.Profile{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := io.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// CreateOfflineProfile createOfflineProfile creates a new profile resource in the offline mode. +// The client provides the profile to create along with the profile bytes, the +// server records it. +func (c *profilerRESTClient) CreateOfflineProfile(ctx context.Context, req *cloudprofilerpb.CreateOfflineProfileRequest, opts ...gax.CallOption) (*cloudprofilerpb.Profile, error) { + m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} + body := req.GetProfile() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v2/%v/profiles:createOffline", req.GetParent()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).CreateOfflineProfile[0:len((*c.CallOptions).CreateOfflineProfile):len((*c.CallOptions).CreateOfflineProfile)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &cloudprofilerpb.Profile{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := io.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// UpdateProfile updateProfile updates the profile bytes and labels on the profile resource +// created in the online mode. Updating the bytes for profiles created in the +// offline mode is currently not supported: the profile content must be +// provided at the time of the profile creation. +func (c *profilerRESTClient) UpdateProfile(ctx context.Context, req *cloudprofilerpb.UpdateProfileRequest, opts ...gax.CallOption) (*cloudprofilerpb.Profile, error) { + m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} + body := req.GetProfile() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v2/%v", req.GetProfile().GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + if req.GetUpdateMask() != nil { + updateMask, err := protojson.Marshal(req.GetUpdateMask()) + if err != nil { + return nil, err + } + params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "profile.name", url.QueryEscape(req.GetProfile().GetName()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).UpdateProfile[0:len((*c.CallOptions).UpdateProfile):len((*c.CallOptions).UpdateProfile)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &cloudprofilerpb.Profile{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := io.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} diff --git a/cloudprofiler/apiv2/profiler_client_example_test.go b/cloudprofiler/apiv2/profiler_client_example_test.go new file mode 100644 index 000000000000..fb9ef26b1a45 --- /dev/null +++ b/cloudprofiler/apiv2/profiler_client_example_test.go @@ -0,0 +1,133 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package cloudprofiler_test + +import ( + "context" + + cloudprofiler "cloud.google.com/go/cloudprofiler/apiv2" + cloudprofilerpb "cloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb" +) + +func ExampleNewProfilerClient() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cloudprofiler.NewProfilerClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleNewProfilerRESTClient() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cloudprofiler.NewProfilerRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleProfilerClient_CreateOfflineProfile() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cloudprofiler.NewProfilerClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cloudprofilerpb.CreateOfflineProfileRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb#CreateOfflineProfileRequest. + } + resp, err := c.CreateOfflineProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProfilerClient_CreateProfile() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cloudprofiler.NewProfilerClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cloudprofilerpb.CreateProfileRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb#CreateProfileRequest. + } + resp, err := c.CreateProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProfilerClient_UpdateProfile() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cloudprofiler.NewProfilerClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cloudprofilerpb.UpdateProfileRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb#UpdateProfileRequest. + } + resp, err := c.UpdateProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/cloudprofiler/apiv2/version.go b/cloudprofiler/apiv2/version.go new file mode 100644 index 000000000000..390afc2e018a --- /dev/null +++ b/cloudprofiler/apiv2/version.go @@ -0,0 +1,23 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by gapicgen. DO NOT EDIT. + +package cloudprofiler + +import "cloud.google.com/go/cloudprofiler/internal" + +func init() { + versionClient = internal.Version +} diff --git a/cloudprofiler/go.mod b/cloudprofiler/go.mod new file mode 100644 index 000000000000..157cb5baf5cc --- /dev/null +++ b/cloudprofiler/go.mod @@ -0,0 +1,31 @@ +module cloud.google.com/go/cloudprofiler + +go 1.19 + +require ( + github.com/googleapis/gax-go/v2 v2.12.0 + google.golang.org/api v0.150.0 + google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 + google.golang.org/grpc v1.59.0 + google.golang.org/protobuf v1.31.0 +) + +require ( + cloud.google.com/go/compute v1.23.2 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/s2a-go v0.1.7 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect + go.opencensus.io v0.24.0 // indirect + golang.org/x/crypto v0.14.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/oauth2 v0.13.0 // indirect + golang.org/x/sync v0.5.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + golang.org/x/time v0.3.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect +) diff --git a/cloudprofiler/go.sum b/cloudprofiler/go.sum new file mode 100644 index 000000000000..23d877d6a844 --- /dev/null +++ b/cloudprofiler/go.sum @@ -0,0 +1,142 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go/compute v1.23.2 h1:nWEMDhgbBkBJjfpVySqU4jgWdc22PLR0o4vEexZHers= +cloud.google.com/go/compute v1.23.2/go.mod h1:JJ0atRC0J/oWYiiVBmsSsrRnh92DhZPG4hFDcR04Rns= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= +github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= +github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.150.0 h1:Z9k22qD289SZ8gCJrk4DrWXkNjtfvKAUo/l1ma8eBYE= +google.golang.org/api v0.150.0/go.mod h1:ccy+MJ6nrYFgE3WgRx/AMXOxOmU8Q4hSa+jjibzhxcg= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 h1:I6WNifs6pF9tNdSob2W24JtyxIYjzFB9qDlpUC76q+U= +google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405/go.mod h1:3WDQMjmJk36UQhjQ89emUzb1mdaHcPeeAh4SCBKznB4= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 h1:AB/lmRny7e2pLhFEYIbl5qkDAUt2h0ZRO4wGPhZf+ik= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/cloudprofiler/internal/version.go b/cloudprofiler/internal/version.go new file mode 100644 index 000000000000..2734cec844c4 --- /dev/null +++ b/cloudprofiler/internal/version.go @@ -0,0 +1,20 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by gapicgen. DO NOT EDIT. + +package internal + +// Version is the current tagged release of the library. +const Version = "0.0.0" diff --git a/go.work b/go.work index fee12e6245e2..a2b319a735ed 100644 --- a/go.work +++ b/go.work @@ -32,6 +32,7 @@ use ( ./channel ./cloudbuild ./clouddms + ./cloudprofiler ./cloudtasks ./commerce ./compute diff --git a/internal/.repo-metadata-full.json b/internal/.repo-metadata-full.json index 1611ca566ec7..4c6d05340589 100644 --- a/internal/.repo-metadata-full.json +++ b/internal/.repo-metadata-full.json @@ -619,6 +619,16 @@ "release_level": "stable", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/cloudprofiler/apiv2": { + "api_shortname": "cloudprofiler", + "distribution_name": "cloud.google.com/go/cloudprofiler/apiv2", + "description": "Cloud Profiler API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/cloudprofiler/latest/apiv2", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/cloudtasks/apiv2": { "api_shortname": "cloudtasks", "distribution_name": "cloud.google.com/go/cloudtasks/apiv2", diff --git a/internal/generated/snippets/cloudprofiler/apiv2/ProfilerClient/CreateOfflineProfile/main.go b/internal/generated/snippets/cloudprofiler/apiv2/ProfilerClient/CreateOfflineProfile/main.go new file mode 100644 index 000000000000..3f7fd4439882 --- /dev/null +++ b/internal/generated/snippets/cloudprofiler/apiv2/ProfilerClient/CreateOfflineProfile/main.go @@ -0,0 +1,53 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +// [START cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_sync] + +package main + +import ( + "context" + + cloudprofiler "cloud.google.com/go/cloudprofiler/apiv2" + cloudprofilerpb "cloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cloudprofiler.NewProfilerClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cloudprofilerpb.CreateOfflineProfileRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb#CreateOfflineProfileRequest. + } + resp, err := c.CreateOfflineProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_sync] diff --git a/internal/generated/snippets/cloudprofiler/apiv2/ProfilerClient/CreateProfile/main.go b/internal/generated/snippets/cloudprofiler/apiv2/ProfilerClient/CreateProfile/main.go new file mode 100644 index 000000000000..756c6c8ad764 --- /dev/null +++ b/internal/generated/snippets/cloudprofiler/apiv2/ProfilerClient/CreateProfile/main.go @@ -0,0 +1,53 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +// [START cloudprofiler_v2_generated_ProfilerService_CreateProfile_sync] + +package main + +import ( + "context" + + cloudprofiler "cloud.google.com/go/cloudprofiler/apiv2" + cloudprofilerpb "cloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cloudprofiler.NewProfilerClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cloudprofilerpb.CreateProfileRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb#CreateProfileRequest. + } + resp, err := c.CreateProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END cloudprofiler_v2_generated_ProfilerService_CreateProfile_sync] diff --git a/internal/generated/snippets/cloudprofiler/apiv2/ProfilerClient/UpdateProfile/main.go b/internal/generated/snippets/cloudprofiler/apiv2/ProfilerClient/UpdateProfile/main.go new file mode 100644 index 000000000000..ae72abc05631 --- /dev/null +++ b/internal/generated/snippets/cloudprofiler/apiv2/ProfilerClient/UpdateProfile/main.go @@ -0,0 +1,53 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +// [START cloudprofiler_v2_generated_ProfilerService_UpdateProfile_sync] + +package main + +import ( + "context" + + cloudprofiler "cloud.google.com/go/cloudprofiler/apiv2" + cloudprofilerpb "cloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cloudprofiler.NewProfilerClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cloudprofilerpb.UpdateProfileRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb#UpdateProfileRequest. + } + resp, err := c.UpdateProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END cloudprofiler_v2_generated_ProfilerService_UpdateProfile_sync] diff --git a/internal/generated/snippets/cloudprofiler/apiv2/snippet_metadata.google.devtools.cloudprofiler.v2.json b/internal/generated/snippets/cloudprofiler/apiv2/snippet_metadata.google.devtools.cloudprofiler.v2.json new file mode 100644 index 000000000000..b34757c8c265 --- /dev/null +++ b/internal/generated/snippets/cloudprofiler/apiv2/snippet_metadata.google.devtools.cloudprofiler.v2.json @@ -0,0 +1,153 @@ +{ + "clientLibrary": { + "name": "cloud.google.com/go/cloudprofiler/apiv2", + "version": "0.0.0", + "language": "GO", + "apis": [ + { + "id": "google.devtools.cloudprofiler.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_sync", + "title": "cloudprofiler CreateOfflineProfile Sample", + "description": "CreateOfflineProfile createOfflineProfile creates a new profile resource in the offline mode.\nThe client provides the profile to create along with the profile bytes, the\nserver records it.", + "file": "ProfilerClient/CreateOfflineProfile/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateOfflineProfile", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerClient.CreateOfflineProfile", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "cloudprofilerpb.CreateOfflineProfileRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "*cloudprofilerpb.Profile", + "client": { + "shortName": "ProfilerClient", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerClient" + }, + "method": { + "shortName": "CreateOfflineProfile", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerService.CreateOfflineProfile", + "service": { + "shortName": "ProfilerService", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 53, + "type": "FULL" + } + ] + }, + { + "regionTag": "cloudprofiler_v2_generated_ProfilerService_CreateProfile_sync", + "title": "cloudprofiler CreateProfile Sample", + "description": "CreateProfile createProfile creates a new profile resource in the online mode.\n\nThe server ensures that the new profiles are created at a constant rate per\ndeployment, so the creation request may hang for some time until the next\nprofile session is available.\n\nThe request may fail with ABORTED error if the creation is not available\nwithin ~1m, the response will indicate the duration of the backoff the\nclient should take before attempting creating a profile again. The backoff\nduration is returned in google.rpc.RetryInfo extension on the response\nstatus. To a gRPC client, the extension will be return as a\nbinary-serialized proto in the trailing metadata item named\n\"google.rpc.retryinfo-bin\".", + "file": "ProfilerClient/CreateProfile/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateProfile", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerClient.CreateProfile", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "cloudprofilerpb.CreateProfileRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "*cloudprofilerpb.Profile", + "client": { + "shortName": "ProfilerClient", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerClient" + }, + "method": { + "shortName": "CreateProfile", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerService.CreateProfile", + "service": { + "shortName": "ProfilerService", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 53, + "type": "FULL" + } + ] + }, + { + "regionTag": "cloudprofiler_v2_generated_ProfilerService_UpdateProfile_sync", + "title": "cloudprofiler UpdateProfile Sample", + "description": "UpdateProfile updateProfile updates the profile bytes and labels on the profile resource\ncreated in the online mode. Updating the bytes for profiles created in the\noffline mode is currently not supported: the profile content must be\nprovided at the time of the profile creation.", + "file": "ProfilerClient/UpdateProfile/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateProfile", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerClient.UpdateProfile", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "cloudprofilerpb.UpdateProfileRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "*cloudprofilerpb.Profile", + "client": { + "shortName": "ProfilerClient", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerClient" + }, + "method": { + "shortName": "UpdateProfile", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerService.UpdateProfile", + "service": { + "shortName": "ProfilerService", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/internal/generated/snippets/go.mod b/internal/generated/snippets/go.mod index d9b419531ef6..df2291886fb5 100644 --- a/internal/generated/snippets/go.mod +++ b/internal/generated/snippets/go.mod @@ -452,3 +452,5 @@ replace cloud.google.com/go/shopping => ../../../shopping replace cloud.google.com/go/securesourcemanager => ../../../securesourcemanager replace cloud.google.com/go/edgenetwork => ../../../edgenetwork + +replace cloud.google.com/go/cloudprofiler => ../../../cloudprofiler diff --git a/internal/generated/snippets/spanner/admin/database/apiv1/snippet_metadata.google.spanner.admin.database.v1.json b/internal/generated/snippets/spanner/admin/database/apiv1/snippet_metadata.google.spanner.admin.database.v1.json index a8aea429788b..1f3dbf0ecd51 100644 --- a/internal/generated/snippets/spanner/admin/database/apiv1/snippet_metadata.google.spanner.admin.database.v1.json +++ b/internal/generated/snippets/spanner/admin/database/apiv1/snippet_metadata.google.spanner.admin.database.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/spanner/admin/database/apiv1", - "version": "1.51.0", + "version": "1.53.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/spanner/admin/instance/apiv1/snippet_metadata.google.spanner.admin.instance.v1.json b/internal/generated/snippets/spanner/admin/instance/apiv1/snippet_metadata.google.spanner.admin.instance.v1.json index ba3f6c497f6d..d2d5dde9bbe4 100644 --- a/internal/generated/snippets/spanner/admin/instance/apiv1/snippet_metadata.google.spanner.admin.instance.v1.json +++ b/internal/generated/snippets/spanner/admin/instance/apiv1/snippet_metadata.google.spanner.admin.instance.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/spanner/admin/instance/apiv1", - "version": "1.51.0", + "version": "1.53.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/spanner/apiv1/snippet_metadata.google.spanner.v1.json b/internal/generated/snippets/spanner/apiv1/snippet_metadata.google.spanner.v1.json index 6b4680ec5885..2c580a318559 100644 --- a/internal/generated/snippets/spanner/apiv1/snippet_metadata.google.spanner.v1.json +++ b/internal/generated/snippets/spanner/apiv1/snippet_metadata.google.spanner.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/spanner/apiv1", - "version": "1.51.0", + "version": "1.53.0", "language": "GO", "apis": [ { diff --git a/release-please-config-yoshi-submodules.json b/release-please-config-yoshi-submodules.json index 655c70810152..09436b272b1a 100644 --- a/release-please-config-yoshi-submodules.json +++ b/release-please-config-yoshi-submodules.json @@ -81,6 +81,9 @@ "clouddms": { "component": "clouddms" }, + "cloudprofiler": { + "component": "cloudprofiler" + }, "cloudtasks": { "component": "cloudtasks" },