apikeys

package
v1.84.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 13 Imported by: 4

Documentation

Overview

Copyright 2026 Google LLC. All Rights Reserved.

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. Package apikeys provides types and methods for managing apikeys GCP resources.

Copyright 2026 Google LLC. All Rights Reserved.

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. Package apikeys defines operations in the declarative SDK.

Copyright 2026 Google LLC. All Rights Reserved.

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.

Copyright 2026 Google LLC. All Rights Reserved.

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.

Copyright 2026 Google LLC. All Rights Reserved.

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.

Copyright 2026 Google LLC. All Rights Reserved.

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.

Index

Constants

View Source
const KeyMaxPage = -1

Variables

View Source
var YAML_key []byte

Functions

func DCLKeySchema added in v1.10.3

func DCLKeySchema() *dcl.Schema

Types

type Client

type Client struct {
	Config *dcl.Config
}

The Client is the base struct of all operations. This will receive the Get, Delete, List, and Apply operations on all resources.

func NewClient

func NewClient(c *dcl.Config) *Client

NewClient creates a client that retries all operations a few times each.

func (*Client) ApplyKey

func (c *Client) ApplyKey(ctx context.Context, rawDesired *Key, opts ...dcl.ApplyOption) (*Key, error)

func (*Client) DeleteAllKey

func (c *Client) DeleteAllKey(ctx context.Context, project string, filter func(*Key) bool) error

DeleteAllKey deletes all resources that the filter functions returns true on.

func (*Client) DeleteKey

func (c *Client) DeleteKey(ctx context.Context, r *Key) error

func (*Client) GetKey

func (c *Client) GetKey(ctx context.Context, r *Key) (*Key, error)

func (*Client) ListKey

func (c *Client) ListKey(ctx context.Context, project string) (*KeyList, error)

func (*Client) ListKeyWithMaxResults

func (c *Client) ListKeyWithMaxResults(ctx context.Context, project string, pageSize int32) (*KeyList, error)

type Key

type Key struct {
	Name                *string          `json:"name"`
	DisplayName         *string          `json:"displayName"`
	KeyString           *string          `json:"keyString"`
	Uid                 *string          `json:"uid"`
	ServiceAccountEmail *string          `json:"serviceAccountEmail"`
	Restrictions        *KeyRestrictions `json:"restrictions"`
	Project             *string          `json:"project"`
}

func (*Key) Describe

func (r *Key) Describe() dcl.ServiceTypeVersion

Describe returns a simple description of this resource to ensure that automated tools can identify it.

func (*Key) ID

func (r *Key) ID() (string, error)

func (*Key) String

func (r *Key) String() string

type KeyList

type KeyList struct {
	Items []*Key
	// contains filtered or unexported fields
}

func (*KeyList) HasNext

func (l *KeyList) HasNext() bool

func (*KeyList) Next

func (l *KeyList) Next(ctx context.Context, c *Client) error

type KeyRestrictions

type KeyRestrictions struct {
	BrowserKeyRestrictions *KeyRestrictionsBrowserKeyRestrictions `json:"browserKeyRestrictions"`
	ServerKeyRestrictions  *KeyRestrictionsServerKeyRestrictions  `json:"serverKeyRestrictions"`
	AndroidKeyRestrictions *KeyRestrictionsAndroidKeyRestrictions `json:"androidKeyRestrictions"`
	IosKeyRestrictions     *KeyRestrictionsIosKeyRestrictions     `json:"iosKeyRestrictions"`
	ApiTargets             []KeyRestrictionsApiTargets            `json:"apiTargets"`
	// contains filtered or unexported fields
}
var EmptyKeyRestrictions *KeyRestrictions = &KeyRestrictions{empty: true}

This object is used to assert a desired state where this KeyRestrictions is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.

func (*KeyRestrictions) Empty

func (r *KeyRestrictions) Empty() bool

func (*KeyRestrictions) HashCode

func (r *KeyRestrictions) HashCode() string

func (*KeyRestrictions) String

func (r *KeyRestrictions) String() string

func (*KeyRestrictions) UnmarshalJSON

func (r *KeyRestrictions) UnmarshalJSON(data []byte) error

type KeyRestrictionsAndroidKeyRestrictions

type KeyRestrictionsAndroidKeyRestrictions struct {
	AllowedApplications []KeyRestrictionsAndroidKeyRestrictionsAllowedApplications `json:"allowedApplications"`
	// contains filtered or unexported fields
}
var EmptyKeyRestrictionsAndroidKeyRestrictions *KeyRestrictionsAndroidKeyRestrictions = &KeyRestrictionsAndroidKeyRestrictions{empty: true}

This object is used to assert a desired state where this KeyRestrictionsAndroidKeyRestrictions is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.

func (*KeyRestrictionsAndroidKeyRestrictions) Empty

func (*KeyRestrictionsAndroidKeyRestrictions) HashCode

func (*KeyRestrictionsAndroidKeyRestrictions) String

func (*KeyRestrictionsAndroidKeyRestrictions) UnmarshalJSON

func (r *KeyRestrictionsAndroidKeyRestrictions) UnmarshalJSON(data []byte) error

type KeyRestrictionsAndroidKeyRestrictionsAllowedApplications

type KeyRestrictionsAndroidKeyRestrictionsAllowedApplications struct {
	Sha1Fingerprint *string `json:"sha1Fingerprint"`
	PackageName     *string `json:"packageName"`
	// contains filtered or unexported fields
}
var EmptyKeyRestrictionsAndroidKeyRestrictionsAllowedApplications *KeyRestrictionsAndroidKeyRestrictionsAllowedApplications = &KeyRestrictionsAndroidKeyRestrictionsAllowedApplications{empty: true}

This object is used to assert a desired state where this KeyRestrictionsAndroidKeyRestrictionsAllowedApplications is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.

func (*KeyRestrictionsAndroidKeyRestrictionsAllowedApplications) Empty

func (*KeyRestrictionsAndroidKeyRestrictionsAllowedApplications) HashCode

func (*KeyRestrictionsAndroidKeyRestrictionsAllowedApplications) String

func (*KeyRestrictionsAndroidKeyRestrictionsAllowedApplications) UnmarshalJSON

type KeyRestrictionsApiTargets

type KeyRestrictionsApiTargets struct {
	Service *string  `json:"service"`
	Methods []string `json:"methods"`
	// contains filtered or unexported fields
}
var EmptyKeyRestrictionsApiTargets *KeyRestrictionsApiTargets = &KeyRestrictionsApiTargets{empty: true}

This object is used to assert a desired state where this KeyRestrictionsApiTargets is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.

func (*KeyRestrictionsApiTargets) Empty

func (r *KeyRestrictionsApiTargets) Empty() bool

func (*KeyRestrictionsApiTargets) HashCode

func (r *KeyRestrictionsApiTargets) HashCode() string

func (*KeyRestrictionsApiTargets) String

func (r *KeyRestrictionsApiTargets) String() string

func (*KeyRestrictionsApiTargets) UnmarshalJSON

func (r *KeyRestrictionsApiTargets) UnmarshalJSON(data []byte) error

type KeyRestrictionsBrowserKeyRestrictions

type KeyRestrictionsBrowserKeyRestrictions struct {
	AllowedReferrers []string `json:"allowedReferrers"`
	// contains filtered or unexported fields
}
var EmptyKeyRestrictionsBrowserKeyRestrictions *KeyRestrictionsBrowserKeyRestrictions = &KeyRestrictionsBrowserKeyRestrictions{empty: true}

This object is used to assert a desired state where this KeyRestrictionsBrowserKeyRestrictions is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.

func (*KeyRestrictionsBrowserKeyRestrictions) Empty

func (*KeyRestrictionsBrowserKeyRestrictions) HashCode

func (*KeyRestrictionsBrowserKeyRestrictions) String

func (*KeyRestrictionsBrowserKeyRestrictions) UnmarshalJSON

func (r *KeyRestrictionsBrowserKeyRestrictions) UnmarshalJSON(data []byte) error

type KeyRestrictionsIosKeyRestrictions

type KeyRestrictionsIosKeyRestrictions struct {
	AllowedBundleIds []string `json:"allowedBundleIds"`
	// contains filtered or unexported fields
}
var EmptyKeyRestrictionsIosKeyRestrictions *KeyRestrictionsIosKeyRestrictions = &KeyRestrictionsIosKeyRestrictions{empty: true}

This object is used to assert a desired state where this KeyRestrictionsIosKeyRestrictions is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.

func (*KeyRestrictionsIosKeyRestrictions) Empty

func (*KeyRestrictionsIosKeyRestrictions) HashCode

func (*KeyRestrictionsIosKeyRestrictions) String

func (*KeyRestrictionsIosKeyRestrictions) UnmarshalJSON

func (r *KeyRestrictionsIosKeyRestrictions) UnmarshalJSON(data []byte) error

type KeyRestrictionsServerKeyRestrictions

type KeyRestrictionsServerKeyRestrictions struct {
	AllowedIps []string `json:"allowedIps"`
	// contains filtered or unexported fields
}
var EmptyKeyRestrictionsServerKeyRestrictions *KeyRestrictionsServerKeyRestrictions = &KeyRestrictionsServerKeyRestrictions{empty: true}

This object is used to assert a desired state where this KeyRestrictionsServerKeyRestrictions is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.

func (*KeyRestrictionsServerKeyRestrictions) Empty

func (*KeyRestrictionsServerKeyRestrictions) HashCode

func (*KeyRestrictionsServerKeyRestrictions) String

func (*KeyRestrictionsServerKeyRestrictions) UnmarshalJSON

func (r *KeyRestrictionsServerKeyRestrictions) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL