1 // Copyright 2024 Google LLC 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // https://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Code generated by protoc-gen-go_gapic. DO NOT EDIT. 16 17 // Package resourcemanager is an auto-generated package for the 18 // Cloud Resource Manager API. 19 // 20 // Creates, reads, and updates metadata for Google Cloud Platform resource 21 // containers. 22 // 23 // # General documentation 24 // 25 // For information that is relevant for all client libraries please reference 26 // https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this 27 // page includes: 28 // 29 // - [Authentication and Authorization] 30 // - [Timeouts and Cancellation] 31 // - [Testing against Client Libraries] 32 // - [Debugging Client Libraries] 33 // - [Inspecting errors] 34 // 35 // # Example usage 36 // 37 // To get started with this package, create a client. 38 // 39 // ctx := context.Background() 40 // // This snippet has been automatically generated and should be regarded as a code template only. 41 // // It will require modifications to work: 42 // // - It may require correct/in-range values for request initialization. 43 // // - It may require specifying regional endpoints when creating the service client as shown in: 44 // // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 45 // c, err := resourcemanager.NewFoldersClient(ctx) 46 // if err != nil { 47 // // TODO: Handle error. 48 // } 49 // defer c.Close() 50 // 51 // The client will use your default application credentials. Clients should be reused instead of created as needed. 52 // The methods of Client are safe for concurrent use by multiple goroutines. 53 // The returned client must be Closed when it is done being used. 54 // 55 // # Using the Client 56 // 57 // The following is an example of making an API call with the newly created client. 58 // 59 // ctx := context.Background() 60 // // This snippet has been automatically generated and should be regarded as a code template only. 61 // // It will require modifications to work: 62 // // - It may require correct/in-range values for request initialization. 63 // // - It may require specifying regional endpoints when creating the service client as shown in: 64 // // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options 65 // c, err := resourcemanager.NewFoldersClient(ctx) 66 // if err != nil { 67 // // TODO: Handle error. 68 // } 69 // defer c.Close() 70 // 71 // req := &resourcemanagerpb.CreateFolderRequest{ 72 // // TODO: Fill request struct fields. 73 // // See https://pkg.go.dev/cloud.google.com/go/resourcemanager/apiv2/resourcemanagerpb#CreateFolderRequest. 74 // } 75 // op, err := c.CreateFolder(ctx, req) 76 // if err != nil { 77 // // TODO: Handle error. 78 // } 79 // 80 // resp, err := op.Wait(ctx) 81 // if err != nil { 82 // // TODO: Handle error. 83 // } 84 // // TODO: Use resp. 85 // _ = resp 86 // 87 // # Use of Context 88 // 89 // The ctx passed to NewFoldersClient is used for authentication requests and 90 // for creating the underlying connection, but is not used for subsequent calls. 91 // Individual methods on the client use the ctx given to them. 92 // 93 // To close the open connection, use the Close() method. 94 // 95 // [Authentication and Authorization]: https://pkg.go.dev/cloud.google.com/go#hdr-Authentication_and_Authorization 96 // [Timeouts and Cancellation]: https://pkg.go.dev/cloud.google.com/go#hdr-Timeouts_and_Cancellation 97 // [Testing against Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Testing 98 // [Debugging Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Debugging 99 // [Inspecting errors]: https://pkg.go.dev/cloud.google.com/go#hdr-Inspecting_errors 100 package resourcemanager // import "cloud.google.com/go/resourcemanager/apiv2" 101 102 import ( 103 "context" 104 105 "google.golang.org/api/option" 106 ) 107 108 // For more information on implementing a client constructor hook, see 109 // https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. 110 type clientHookParams struct{} 111 type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) 112 113 var versionClient string 114 115 func getVersionClient() string { 116 if versionClient == "" { 117 return "UNKNOWN" 118 } 119 return versionClient 120 } 121 122 // DefaultAuthScopes reports the default set of authentication scopes to use with this package. 123 func DefaultAuthScopes() []string { 124 return []string{ 125 "https://www.googleapis.com/auth/cloud-platform", 126 "https://www.googleapis.com/auth/cloud-platform.read-only", 127 } 128 } 129