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 orgpolicy 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. Package orgpolicy defines types and methods for working with orgpolicy 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.
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
- Variables
- func DCLPolicySchema() *dcl.Schema
- type Client
- func (c *Client) ApplyPolicy(ctx context.Context, rawDesired *Policy, opts ...dcl.ApplyOption) (*Policy, error)
- func (c *Client) DeleteAllPolicy(ctx context.Context, parent string, filter func(*Policy) bool) error
- func (c *Client) DeletePolicy(ctx context.Context, r *Policy) error
- func (c *Client) GetPolicy(ctx context.Context, r *Policy) (*Policy, error)
- func (c *Client) ListPolicy(ctx context.Context, parent string) (*PolicyList, error)
- func (c *Client) ListPolicyWithMaxResults(ctx context.Context, parent string, pageSize int32) (*PolicyList, error)
- type Policy
- type PolicyDryRunSpec
- type PolicyDryRunSpecRules
- type PolicyDryRunSpecRulesCondition
- type PolicyDryRunSpecRulesValues
- type PolicyList
- type PolicySpec
- type PolicySpecRules
- type PolicySpecRulesCondition
- type PolicySpecRulesValues
Constants ¶
const PolicyMaxPage = -1
Variables ¶
var YAML_policy []byte
Functions ¶
func DCLPolicySchema ¶ added in v1.10.3
Types ¶
type Client ¶
The Client is the base struct of all operations. This will receive the Get, Delete, List, and Apply operations on all resources.
func (*Client) ApplyPolicy ¶
func (*Client) DeleteAllPolicy ¶
func (c *Client) DeleteAllPolicy(ctx context.Context, parent string, filter func(*Policy) bool) error
DeleteAllPolicy deletes all resources that the filter functions returns true on.
func (*Client) ListPolicy ¶
func (*Client) ListPolicyWithMaxResults ¶
type Policy ¶
type Policy struct {
Name *string `json:"name"`
Spec *PolicySpec `json:"spec"`
DryRunSpec *PolicyDryRunSpec `json:"dryRunSpec"`
Etag *string `json:"etag"`
Parent *string `json:"parent"`
}
func (*Policy) Describe ¶
func (r *Policy) Describe() dcl.ServiceTypeVersion
Describe returns a simple description of this resource to ensure that automated tools can identify it.
type PolicyDryRunSpec ¶ added in v1.55.0
type PolicyDryRunSpec struct {
Etag *string `json:"etag"`
UpdateTime *string `json:"updateTime"`
Rules []PolicyDryRunSpecRules `json:"rules"`
InheritFromParent *bool `json:"inheritFromParent"`
Reset *bool `json:"reset"`
// contains filtered or unexported fields
}
var EmptyPolicyDryRunSpec *PolicyDryRunSpec = &PolicyDryRunSpec{empty: true}
This object is used to assert a desired state where this PolicyDryRunSpec is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*PolicyDryRunSpec) Empty ¶ added in v1.55.0
func (r *PolicyDryRunSpec) Empty() bool
func (*PolicyDryRunSpec) HashCode ¶ added in v1.55.0
func (r *PolicyDryRunSpec) HashCode() string
func (*PolicyDryRunSpec) String ¶ added in v1.55.0
func (r *PolicyDryRunSpec) String() string
func (*PolicyDryRunSpec) UnmarshalJSON ¶ added in v1.55.0
func (r *PolicyDryRunSpec) UnmarshalJSON(data []byte) error
type PolicyDryRunSpecRules ¶ added in v1.55.0
type PolicyDryRunSpecRules struct {
Values *PolicyDryRunSpecRulesValues `json:"values"`
AllowAll *bool `json:"allowAll"`
DenyAll *bool `json:"denyAll"`
Enforce *bool `json:"enforce"`
Condition *PolicyDryRunSpecRulesCondition `json:"condition"`
// contains filtered or unexported fields
}
var EmptyPolicyDryRunSpecRules *PolicyDryRunSpecRules = &PolicyDryRunSpecRules{empty: true}
This object is used to assert a desired state where this PolicyDryRunSpecRules is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*PolicyDryRunSpecRules) Empty ¶ added in v1.55.0
func (r *PolicyDryRunSpecRules) Empty() bool
func (*PolicyDryRunSpecRules) HashCode ¶ added in v1.55.0
func (r *PolicyDryRunSpecRules) HashCode() string
func (*PolicyDryRunSpecRules) String ¶ added in v1.55.0
func (r *PolicyDryRunSpecRules) String() string
func (*PolicyDryRunSpecRules) UnmarshalJSON ¶ added in v1.55.0
func (r *PolicyDryRunSpecRules) UnmarshalJSON(data []byte) error
type PolicyDryRunSpecRulesCondition ¶ added in v1.55.0
type PolicyDryRunSpecRulesCondition struct {
Expression *string `json:"expression"`
Title *string `json:"title"`
Description *string `json:"description"`
Location *string `json:"location"`
// contains filtered or unexported fields
}
var EmptyPolicyDryRunSpecRulesCondition *PolicyDryRunSpecRulesCondition = &PolicyDryRunSpecRulesCondition{empty: true}
This object is used to assert a desired state where this PolicyDryRunSpecRulesCondition is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*PolicyDryRunSpecRulesCondition) Empty ¶ added in v1.55.0
func (r *PolicyDryRunSpecRulesCondition) Empty() bool
func (*PolicyDryRunSpecRulesCondition) HashCode ¶ added in v1.55.0
func (r *PolicyDryRunSpecRulesCondition) HashCode() string
func (*PolicyDryRunSpecRulesCondition) String ¶ added in v1.55.0
func (r *PolicyDryRunSpecRulesCondition) String() string
func (*PolicyDryRunSpecRulesCondition) UnmarshalJSON ¶ added in v1.55.0
func (r *PolicyDryRunSpecRulesCondition) UnmarshalJSON(data []byte) error
type PolicyDryRunSpecRulesValues ¶ added in v1.55.0
type PolicyDryRunSpecRulesValues struct {
AllowedValues []string `json:"allowedValues"`
DeniedValues []string `json:"deniedValues"`
// contains filtered or unexported fields
}
var EmptyPolicyDryRunSpecRulesValues *PolicyDryRunSpecRulesValues = &PolicyDryRunSpecRulesValues{empty: true}
This object is used to assert a desired state where this PolicyDryRunSpecRulesValues is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*PolicyDryRunSpecRulesValues) Empty ¶ added in v1.55.0
func (r *PolicyDryRunSpecRulesValues) Empty() bool
func (*PolicyDryRunSpecRulesValues) HashCode ¶ added in v1.55.0
func (r *PolicyDryRunSpecRulesValues) HashCode() string
func (*PolicyDryRunSpecRulesValues) String ¶ added in v1.55.0
func (r *PolicyDryRunSpecRulesValues) String() string
func (*PolicyDryRunSpecRulesValues) UnmarshalJSON ¶ added in v1.55.0
func (r *PolicyDryRunSpecRulesValues) UnmarshalJSON(data []byte) error
type PolicyList ¶
type PolicyList struct {
Items []*Policy
// contains filtered or unexported fields
}
func (*PolicyList) HasNext ¶
func (l *PolicyList) HasNext() bool
type PolicySpec ¶
type PolicySpec struct {
Etag *string `json:"etag"`
UpdateTime *string `json:"updateTime"`
Rules []PolicySpecRules `json:"rules"`
InheritFromParent *bool `json:"inheritFromParent"`
Reset *bool `json:"reset"`
// contains filtered or unexported fields
}
var EmptyPolicySpec *PolicySpec = &PolicySpec{empty: true}
This object is used to assert a desired state where this PolicySpec is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*PolicySpec) Empty ¶
func (r *PolicySpec) Empty() bool
func (*PolicySpec) HashCode ¶
func (r *PolicySpec) HashCode() string
func (*PolicySpec) String ¶
func (r *PolicySpec) String() string
func (*PolicySpec) UnmarshalJSON ¶
func (r *PolicySpec) UnmarshalJSON(data []byte) error
type PolicySpecRules ¶
type PolicySpecRules struct {
Values *PolicySpecRulesValues `json:"values"`
AllowAll *bool `json:"allowAll"`
DenyAll *bool `json:"denyAll"`
Enforce *bool `json:"enforce"`
Condition *PolicySpecRulesCondition `json:"condition"`
// contains filtered or unexported fields
}
var EmptyPolicySpecRules *PolicySpecRules = &PolicySpecRules{empty: true}
This object is used to assert a desired state where this PolicySpecRules is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*PolicySpecRules) Empty ¶
func (r *PolicySpecRules) Empty() bool
func (*PolicySpecRules) HashCode ¶
func (r *PolicySpecRules) HashCode() string
func (*PolicySpecRules) String ¶
func (r *PolicySpecRules) String() string
func (*PolicySpecRules) UnmarshalJSON ¶
func (r *PolicySpecRules) UnmarshalJSON(data []byte) error
type PolicySpecRulesCondition ¶
type PolicySpecRulesCondition struct {
Expression *string `json:"expression"`
Title *string `json:"title"`
Description *string `json:"description"`
Location *string `json:"location"`
// contains filtered or unexported fields
}
var EmptyPolicySpecRulesCondition *PolicySpecRulesCondition = &PolicySpecRulesCondition{empty: true}
This object is used to assert a desired state where this PolicySpecRulesCondition is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*PolicySpecRulesCondition) Empty ¶
func (r *PolicySpecRulesCondition) Empty() bool
func (*PolicySpecRulesCondition) HashCode ¶
func (r *PolicySpecRulesCondition) HashCode() string
func (*PolicySpecRulesCondition) String ¶
func (r *PolicySpecRulesCondition) String() string
func (*PolicySpecRulesCondition) UnmarshalJSON ¶
func (r *PolicySpecRulesCondition) UnmarshalJSON(data []byte) error
type PolicySpecRulesValues ¶
type PolicySpecRulesValues struct {
AllowedValues []string `json:"allowedValues"`
DeniedValues []string `json:"deniedValues"`
// contains filtered or unexported fields
}
var EmptyPolicySpecRulesValues *PolicySpecRulesValues = &PolicySpecRulesValues{empty: true}
This object is used to assert a desired state where this PolicySpecRulesValues is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*PolicySpecRulesValues) Empty ¶
func (r *PolicySpecRulesValues) Empty() bool
func (*PolicySpecRulesValues) HashCode ¶
func (r *PolicySpecRulesValues) HashCode() string
func (*PolicySpecRulesValues) String ¶
func (r *PolicySpecRulesValues) String() string
func (*PolicySpecRulesValues) UnmarshalJSON ¶
func (r *PolicySpecRulesValues) UnmarshalJSON(data []byte) error