|
| 1 | +/* |
| 2 | +Copyright © 2022 VMware, Inc. All Rights Reserved. |
| 3 | +SPDX-License-Identifier: MPL-2.0 |
| 4 | +Code generated by go-swagger; DO NOT EDIT. |
| 5 | +*/ |
| 6 | + |
| 7 | +package policyrecipeimagemodel |
| 8 | + |
| 9 | +import ( |
| 10 | + "github.com/go-openapi/swag" |
| 11 | + |
| 12 | + policyrecipeimagecommonmodel "github.com/vmware/terraform-provider-tanzu-mission-control/internal/models/policy/recipe/image/common" |
| 13 | +) |
| 14 | + |
| 15 | +// VmwareTanzuManageV1alpha1CommonPolicySpecImageV1Custom is model for custom recipe version v1 |
| 16 | +// |
| 17 | +// The input schema for image policy custom recipe. |
| 18 | +// |
| 19 | +// swagger:model VmwareTanzuManageV1alpha1CommonPolicySpecImageV1Custom |
| 20 | +type VmwareTanzuManageV1alpha1CommonPolicySpecImageV1Custom struct { |
| 21 | + |
| 22 | + // Audit (dry-run) |
| 23 | + // Creates this policy for dry-run. Violations will be logged but not denied. Defaults to false (deny). |
| 24 | + Audit *bool `json:"audit,omitempty"` |
| 25 | + |
| 26 | + // This specifies a list of rules that defines allowed image patterns. |
| 27 | + // Required: true |
| 28 | + // Min Items: 1 |
| 29 | + Rules []*VmwareTanzuManageV1alpha1CommonPolicySpecImageV1CustomRules `json:"rules"` |
| 30 | +} |
| 31 | + |
| 32 | +// MarshalBinary interface implementation |
| 33 | +func (m *VmwareTanzuManageV1alpha1CommonPolicySpecImageV1Custom) MarshalBinary() ([]byte, error) { |
| 34 | + if m == nil { |
| 35 | + return nil, nil |
| 36 | + } |
| 37 | + |
| 38 | + return swag.WriteJSON(m) |
| 39 | +} |
| 40 | + |
| 41 | +// UnmarshalBinary interface implementation |
| 42 | +func (m *VmwareTanzuManageV1alpha1CommonPolicySpecImageV1Custom) UnmarshalBinary(b []byte) error { |
| 43 | + var res VmwareTanzuManageV1alpha1CommonPolicySpecImageV1Custom |
| 44 | + if err := swag.ReadJSON(b, &res); err != nil { |
| 45 | + return err |
| 46 | + } |
| 47 | + |
| 48 | + *m = res |
| 49 | + |
| 50 | + return nil |
| 51 | +} |
| 52 | + |
| 53 | +// VmwareTanzuManageV1alpha1CommonPolicySpecImageV1CustomRules Rules. |
| 54 | +// |
| 55 | +// swagger:model VmwareTanzuManageV1alpha1CommonPolicySpecImageV1CustomRules |
| 56 | +type VmwareTanzuManageV1alpha1CommonPolicySpecImageV1CustomRules struct { |
| 57 | + |
| 58 | + // Allowed image hostnames, wildcards are supported(for example: *.mycompany.com). Empty field is equivalent to *. |
| 59 | + Hostname string `json:"hostname,omitempty"` |
| 60 | + |
| 61 | + // Allowed image names, wildcards are supported(for example: fooservice/*). Empty field is equivalent to *. |
| 62 | + ImageName string `json:"imageName,omitempty"` |
| 63 | + |
| 64 | + // Allowed port(if presented) of the image hostname, must associate with valid hostname. Wildcards are supported. |
| 65 | + Port string `json:"port,omitempty"` |
| 66 | + |
| 67 | + // The flag used to enforce digest to appear in container images. |
| 68 | + RequireDigest *bool `json:"requireDigest,omitempty"` |
| 69 | + |
| 70 | + // Tag |
| 71 | + Tag *policyrecipeimagecommonmodel.VmwareTanzuManageV1alpha1CommonPolicySpecImageV1RulesTag `json:"tag,omitempty"` |
| 72 | +} |
| 73 | + |
| 74 | +// MarshalBinary interface implementation |
| 75 | +func (m *VmwareTanzuManageV1alpha1CommonPolicySpecImageV1CustomRules) MarshalBinary() ([]byte, error) { |
| 76 | + if m == nil { |
| 77 | + return nil, nil |
| 78 | + } |
| 79 | + |
| 80 | + return swag.WriteJSON(m) |
| 81 | +} |
| 82 | + |
| 83 | +// UnmarshalBinary interface implementation |
| 84 | +func (m *VmwareTanzuManageV1alpha1CommonPolicySpecImageV1CustomRules) UnmarshalBinary(b []byte) error { |
| 85 | + var res VmwareTanzuManageV1alpha1CommonPolicySpecImageV1CustomRules |
| 86 | + if err := swag.ReadJSON(b, &res); err != nil { |
| 87 | + return err |
| 88 | + } |
| 89 | + |
| 90 | + *m = res |
| 91 | + |
| 92 | + return nil |
| 93 | +} |
0 commit comments