blob: dd34d21177c59257dc693b82c7804f80899c35da [file] [log] [blame]
// Copyright 2021 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 osconfig_test
import (
"context"
osconfig "cloud.google.com/go/osconfig/apiv1alpha"
"google.golang.org/api/iterator"
osconfigpb "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha"
)
func ExampleNewOsConfigZonalClient() {
ctx := context.Background()
c, err := osconfig.NewOsConfigZonalClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func ExampleOsConfigZonalClient_CreateOSPolicyAssignment() {
ctx := context.Background()
c, err := osconfig.NewOsConfigZonalClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &osconfigpb.CreateOSPolicyAssignmentRequest{
// TODO: Fill request struct fields.
}
op, err := c.CreateOSPolicyAssignment(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleOsConfigZonalClient_UpdateOSPolicyAssignment() {
ctx := context.Background()
c, err := osconfig.NewOsConfigZonalClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &osconfigpb.UpdateOSPolicyAssignmentRequest{
// TODO: Fill request struct fields.
}
op, err := c.UpdateOSPolicyAssignment(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleOsConfigZonalClient_GetOSPolicyAssignment() {
ctx := context.Background()
c, err := osconfig.NewOsConfigZonalClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &osconfigpb.GetOSPolicyAssignmentRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetOSPolicyAssignment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleOsConfigZonalClient_ListOSPolicyAssignments() {
ctx := context.Background()
c, err := osconfig.NewOsConfigZonalClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &osconfigpb.ListOSPolicyAssignmentsRequest{
// TODO: Fill request struct fields.
}
it := c.ListOSPolicyAssignments(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleOsConfigZonalClient_ListOSPolicyAssignmentRevisions() {
ctx := context.Background()
c, err := osconfig.NewOsConfigZonalClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &osconfigpb.ListOSPolicyAssignmentRevisionsRequest{
// TODO: Fill request struct fields.
}
it := c.ListOSPolicyAssignmentRevisions(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleOsConfigZonalClient_DeleteOSPolicyAssignment() {
ctx := context.Background()
c, err := osconfig.NewOsConfigZonalClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &osconfigpb.DeleteOSPolicyAssignmentRequest{
// TODO: Fill request struct fields.
}
op, err := c.DeleteOSPolicyAssignment(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func ExampleOsConfigZonalClient_GetInstanceOSPoliciesCompliance() {
ctx := context.Background()
c, err := osconfig.NewOsConfigZonalClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &osconfigpb.GetInstanceOSPoliciesComplianceRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetInstanceOSPoliciesCompliance(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleOsConfigZonalClient_ListInstanceOSPoliciesCompliances() {
ctx := context.Background()
c, err := osconfig.NewOsConfigZonalClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &osconfigpb.ListInstanceOSPoliciesCompliancesRequest{
// TODO: Fill request struct fields.
}
it := c.ListInstanceOSPoliciesCompliances(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleOsConfigZonalClient_GetInventory() {
ctx := context.Background()
c, err := osconfig.NewOsConfigZonalClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &osconfigpb.GetInventoryRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetInventory(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleOsConfigZonalClient_ListInventories() {
ctx := context.Background()
c, err := osconfig.NewOsConfigZonalClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &osconfigpb.ListInventoriesRequest{
// TODO: Fill request struct fields.
}
it := c.ListInventories(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleOsConfigZonalClient_GetVulnerabilityReport() {
ctx := context.Background()
c, err := osconfig.NewOsConfigZonalClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &osconfigpb.GetVulnerabilityReportRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetVulnerabilityReport(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleOsConfigZonalClient_ListVulnerabilityReports() {
ctx := context.Background()
c, err := osconfig.NewOsConfigZonalClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &osconfigpb.ListVulnerabilityReportsRequest{
// TODO: Fill request struct fields.
}
it := c.ListVulnerabilityReports(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}