From e22fd60e704cee8182d43bb65b689722be9bfeac Mon Sep 17 00:00:00 2001 From: Jason Zhang Date: Mon, 20 Jan 2025 16:34:31 +0800 Subject: [PATCH] add smn resources --- .../v1alpha1/zz_generated.conversion_hubs.go | 28 + apis/smn/v1alpha1/zz_generated.deepcopy.go | 2339 +++++++++++++++++ apis/smn/v1alpha1/zz_generated.managed.go | 429 +++ apis/smn/v1alpha1/zz_generated.managedlist.go | 72 + apis/smn/v1alpha1/zz_generated.resolvers.go | 225 ++ apis/smn/v1alpha1/zz_groupversion_info.go | 32 + apis/smn/v1alpha1/zz_logtank_terraformed.go | 129 + apis/smn/v1alpha1/zz_logtank_types.go | 164 ++ .../zz_messagedetection_terraformed.go | 129 + .../smn/v1alpha1/zz_messagedetection_types.go | 198 ++ .../v1alpha1/zz_messagepublish_terraformed.go | 136 + apis/smn/v1alpha1/zz_messagepublish_types.go | 329 +++ .../zz_messagetemplate_terraformed.go | 129 + apis/smn/v1alpha1/zz_messagetemplate_types.go | 162 ++ .../v1alpha1/zz_subscription_terraformed.go | 129 + apis/smn/v1alpha1/zz_subscription_types.go | 301 +++ ...zz_subscriptionfilterpolicy_terraformed.go | 129 + .../zz_subscriptionfilterpolicy_types.go | 202 ++ apis/smn/v1alpha1/zz_topic_terraformed.go | 136 + apis/smn/v1alpha1/zz_topic_types.go | 223 ++ apis/zz_register.go | 2 + config/external_name.go | 8 + config/provider.go | 2 + config/smn/config.go | 71 + examples-generated/smn/v1alpha1/logtank.yaml | 29 + .../smn/v1alpha1/messagedetection.yaml | 15 + .../smn/v1alpha1/messagepublish.yaml | 15 + .../smn/v1alpha1/messagetemplate.yaml | 13 + .../smn/v1alpha1/subscription.yaml | 31 + .../v1alpha1/subscriptionfilterpolicy.yaml | 18 + examples-generated/smn/v1alpha1/topic.yaml | 12 + .../controller/smn/logtank/zz_controller.go | 87 + .../smn/messagedetection/zz_controller.go | 87 + .../smn/messagepublish/zz_controller.go | 87 + .../smn/messagetemplate/zz_controller.go | 87 + .../smn/subscription/zz_controller.go | 87 + .../subscriptionfilterpolicy/zz_controller.go | 87 + .../controller/smn/topic/zz_controller.go | 87 + internal/controller/zz_setup.go | 14 + ...mn.huaweicloud.crossplane.io_logtanks.yaml | 540 ++++ ...cloud.crossplane.io_messagedetections.yaml | 591 +++++ ...icloud.crossplane.io_messagepublishes.yaml | 736 ++++++ ...icloud.crossplane.io_messagetemplates.yaml | 422 +++ ...ssplane.io_subscriptionfilterpolicies.yaml | 593 +++++ ...aweicloud.crossplane.io_subscriptions.yaml | 692 +++++ .../smn.huaweicloud.crossplane.io_topics.yaml | 487 ++++ 46 files changed, 10521 insertions(+) create mode 100755 apis/smn/v1alpha1/zz_generated.conversion_hubs.go create mode 100644 apis/smn/v1alpha1/zz_generated.deepcopy.go create mode 100644 apis/smn/v1alpha1/zz_generated.managed.go create mode 100644 apis/smn/v1alpha1/zz_generated.managedlist.go create mode 100644 apis/smn/v1alpha1/zz_generated.resolvers.go create mode 100755 apis/smn/v1alpha1/zz_groupversion_info.go create mode 100755 apis/smn/v1alpha1/zz_logtank_terraformed.go create mode 100755 apis/smn/v1alpha1/zz_logtank_types.go create mode 100755 apis/smn/v1alpha1/zz_messagedetection_terraformed.go create mode 100755 apis/smn/v1alpha1/zz_messagedetection_types.go create mode 100755 apis/smn/v1alpha1/zz_messagepublish_terraformed.go create mode 100755 apis/smn/v1alpha1/zz_messagepublish_types.go create mode 100755 apis/smn/v1alpha1/zz_messagetemplate_terraformed.go create mode 100755 apis/smn/v1alpha1/zz_messagetemplate_types.go create mode 100755 apis/smn/v1alpha1/zz_subscription_terraformed.go create mode 100755 apis/smn/v1alpha1/zz_subscription_types.go create mode 100755 apis/smn/v1alpha1/zz_subscriptionfilterpolicy_terraformed.go create mode 100755 apis/smn/v1alpha1/zz_subscriptionfilterpolicy_types.go create mode 100755 apis/smn/v1alpha1/zz_topic_terraformed.go create mode 100755 apis/smn/v1alpha1/zz_topic_types.go create mode 100644 config/smn/config.go create mode 100644 examples-generated/smn/v1alpha1/logtank.yaml create mode 100644 examples-generated/smn/v1alpha1/messagedetection.yaml create mode 100644 examples-generated/smn/v1alpha1/messagepublish.yaml create mode 100644 examples-generated/smn/v1alpha1/messagetemplate.yaml create mode 100644 examples-generated/smn/v1alpha1/subscription.yaml create mode 100644 examples-generated/smn/v1alpha1/subscriptionfilterpolicy.yaml create mode 100644 examples-generated/smn/v1alpha1/topic.yaml create mode 100755 internal/controller/smn/logtank/zz_controller.go create mode 100755 internal/controller/smn/messagedetection/zz_controller.go create mode 100755 internal/controller/smn/messagepublish/zz_controller.go create mode 100755 internal/controller/smn/messagetemplate/zz_controller.go create mode 100755 internal/controller/smn/subscription/zz_controller.go create mode 100755 internal/controller/smn/subscriptionfilterpolicy/zz_controller.go create mode 100755 internal/controller/smn/topic/zz_controller.go create mode 100644 package/crds/smn.huaweicloud.crossplane.io_logtanks.yaml create mode 100644 package/crds/smn.huaweicloud.crossplane.io_messagedetections.yaml create mode 100644 package/crds/smn.huaweicloud.crossplane.io_messagepublishes.yaml create mode 100644 package/crds/smn.huaweicloud.crossplane.io_messagetemplates.yaml create mode 100644 package/crds/smn.huaweicloud.crossplane.io_subscriptionfilterpolicies.yaml create mode 100644 package/crds/smn.huaweicloud.crossplane.io_subscriptions.yaml create mode 100644 package/crds/smn.huaweicloud.crossplane.io_topics.yaml diff --git a/apis/smn/v1alpha1/zz_generated.conversion_hubs.go b/apis/smn/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..1f5f1da --- /dev/null +++ b/apis/smn/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,28 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *Logtank) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *MessageDetection) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *MessagePublish) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *MessageTemplate) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Subscription) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *SubscriptionFilterPolicy) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Topic) Hub() {} diff --git a/apis/smn/v1alpha1/zz_generated.deepcopy.go b/apis/smn/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000..4ee4bb4 --- /dev/null +++ b/apis/smn/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,2339 @@ +//go:build !ignore_autogenerated + +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "github.com/crossplane/crossplane-runtime/apis/common/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExtensionInitParameters) DeepCopyInto(out *ExtensionInitParameters) { + *out = *in + if in.ClientID != nil { + in, out := &in.ClientID, &out.ClientID + *out = new(string) + **out = **in + } + if in.ClientSecret != nil { + in, out := &in.ClientSecret, &out.ClientSecret + *out = new(string) + **out = **in + } + if in.Keyword != nil { + in, out := &in.Keyword, &out.Keyword + *out = new(string) + **out = **in + } + if in.SignSecret != nil { + in, out := &in.SignSecret, &out.SignSecret + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionInitParameters. +func (in *ExtensionInitParameters) DeepCopy() *ExtensionInitParameters { + if in == nil { + return nil + } + out := new(ExtensionInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExtensionObservation) DeepCopyInto(out *ExtensionObservation) { + *out = *in + if in.ClientID != nil { + in, out := &in.ClientID, &out.ClientID + *out = new(string) + **out = **in + } + if in.ClientSecret != nil { + in, out := &in.ClientSecret, &out.ClientSecret + *out = new(string) + **out = **in + } + if in.Keyword != nil { + in, out := &in.Keyword, &out.Keyword + *out = new(string) + **out = **in + } + if in.SignSecret != nil { + in, out := &in.SignSecret, &out.SignSecret + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionObservation. +func (in *ExtensionObservation) DeepCopy() *ExtensionObservation { + if in == nil { + return nil + } + out := new(ExtensionObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExtensionParameters) DeepCopyInto(out *ExtensionParameters) { + *out = *in + if in.ClientID != nil { + in, out := &in.ClientID, &out.ClientID + *out = new(string) + **out = **in + } + if in.ClientSecret != nil { + in, out := &in.ClientSecret, &out.ClientSecret + *out = new(string) + **out = **in + } + if in.Keyword != nil { + in, out := &in.Keyword, &out.Keyword + *out = new(string) + **out = **in + } + if in.SignSecret != nil { + in, out := &in.SignSecret, &out.SignSecret + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionParameters. +func (in *ExtensionParameters) DeepCopy() *ExtensionParameters { + if in == nil { + return nil + } + out := new(ExtensionParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FilterPoliciesInitParameters) DeepCopyInto(out *FilterPoliciesInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FilterPoliciesInitParameters. +func (in *FilterPoliciesInitParameters) DeepCopy() *FilterPoliciesInitParameters { + if in == nil { + return nil + } + out := new(FilterPoliciesInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FilterPoliciesObservation) DeepCopyInto(out *FilterPoliciesObservation) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.StringEquals != nil { + in, out := &in.StringEquals, &out.StringEquals + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FilterPoliciesObservation. +func (in *FilterPoliciesObservation) DeepCopy() *FilterPoliciesObservation { + if in == nil { + return nil + } + out := new(FilterPoliciesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FilterPoliciesParameters) DeepCopyInto(out *FilterPoliciesParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FilterPoliciesParameters. +func (in *FilterPoliciesParameters) DeepCopy() *FilterPoliciesParameters { + if in == nil { + return nil + } + out := new(FilterPoliciesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Logtank) DeepCopyInto(out *Logtank) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Logtank. +func (in *Logtank) DeepCopy() *Logtank { + if in == nil { + return nil + } + out := new(Logtank) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Logtank) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogtankInitParameters) DeepCopyInto(out *LogtankInitParameters) { + *out = *in + if in.LogGroupID != nil { + in, out := &in.LogGroupID, &out.LogGroupID + *out = new(string) + **out = **in + } + if in.LogStreamID != nil { + in, out := &in.LogStreamID, &out.LogStreamID + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.TopicUrn != nil { + in, out := &in.TopicUrn, &out.TopicUrn + *out = new(string) + **out = **in + } + if in.TopicUrnRef != nil { + in, out := &in.TopicUrnRef, &out.TopicUrnRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.TopicUrnSelector != nil { + in, out := &in.TopicUrnSelector, &out.TopicUrnSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogtankInitParameters. +func (in *LogtankInitParameters) DeepCopy() *LogtankInitParameters { + if in == nil { + return nil + } + out := new(LogtankInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogtankList) DeepCopyInto(out *LogtankList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Logtank, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogtankList. +func (in *LogtankList) DeepCopy() *LogtankList { + if in == nil { + return nil + } + out := new(LogtankList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LogtankList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogtankObservation) DeepCopyInto(out *LogtankObservation) { + *out = *in + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.LogGroupID != nil { + in, out := &in.LogGroupID, &out.LogGroupID + *out = new(string) + **out = **in + } + if in.LogStreamID != nil { + in, out := &in.LogStreamID, &out.LogStreamID + *out = new(string) + **out = **in + } + if in.LogtankID != nil { + in, out := &in.LogtankID, &out.LogtankID + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.TopicUrn != nil { + in, out := &in.TopicUrn, &out.TopicUrn + *out = new(string) + **out = **in + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogtankObservation. +func (in *LogtankObservation) DeepCopy() *LogtankObservation { + if in == nil { + return nil + } + out := new(LogtankObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogtankParameters) DeepCopyInto(out *LogtankParameters) { + *out = *in + if in.LogGroupID != nil { + in, out := &in.LogGroupID, &out.LogGroupID + *out = new(string) + **out = **in + } + if in.LogStreamID != nil { + in, out := &in.LogStreamID, &out.LogStreamID + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.TopicUrn != nil { + in, out := &in.TopicUrn, &out.TopicUrn + *out = new(string) + **out = **in + } + if in.TopicUrnRef != nil { + in, out := &in.TopicUrnRef, &out.TopicUrnRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.TopicUrnSelector != nil { + in, out := &in.TopicUrnSelector, &out.TopicUrnSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogtankParameters. +func (in *LogtankParameters) DeepCopy() *LogtankParameters { + if in == nil { + return nil + } + out := new(LogtankParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogtankSpec) DeepCopyInto(out *LogtankSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogtankSpec. +func (in *LogtankSpec) DeepCopy() *LogtankSpec { + if in == nil { + return nil + } + out := new(LogtankSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogtankStatus) DeepCopyInto(out *LogtankStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogtankStatus. +func (in *LogtankStatus) DeepCopy() *LogtankStatus { + if in == nil { + return nil + } + out := new(LogtankStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageAttributesInitParameters) DeepCopyInto(out *MessageAttributesInitParameters) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(string) + **out = **in + } + if in.Values != nil { + in, out := &in.Values, &out.Values + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageAttributesInitParameters. +func (in *MessageAttributesInitParameters) DeepCopy() *MessageAttributesInitParameters { + if in == nil { + return nil + } + out := new(MessageAttributesInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageAttributesObservation) DeepCopyInto(out *MessageAttributesObservation) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(string) + **out = **in + } + if in.Values != nil { + in, out := &in.Values, &out.Values + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageAttributesObservation. +func (in *MessageAttributesObservation) DeepCopy() *MessageAttributesObservation { + if in == nil { + return nil + } + out := new(MessageAttributesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageAttributesParameters) DeepCopyInto(out *MessageAttributesParameters) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(string) + **out = **in + } + if in.Values != nil { + in, out := &in.Values, &out.Values + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageAttributesParameters. +func (in *MessageAttributesParameters) DeepCopy() *MessageAttributesParameters { + if in == nil { + return nil + } + out := new(MessageAttributesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageDetection) DeepCopyInto(out *MessageDetection) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageDetection. +func (in *MessageDetection) DeepCopy() *MessageDetection { + if in == nil { + return nil + } + out := new(MessageDetection) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MessageDetection) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageDetectionInitParameters) DeepCopyInto(out *MessageDetectionInitParameters) { + *out = *in + if in.EnableForceNew != nil { + in, out := &in.EnableForceNew, &out.EnableForceNew + *out = new(string) + **out = **in + } + if in.Endpoint != nil { + in, out := &in.Endpoint, &out.Endpoint + *out = new(string) + **out = **in + } + if in.Extension != nil { + in, out := &in.Extension, &out.Extension + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.TopicUrn != nil { + in, out := &in.TopicUrn, &out.TopicUrn + *out = new(string) + **out = **in + } + if in.TopicUrnRef != nil { + in, out := &in.TopicUrnRef, &out.TopicUrnRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.TopicUrnSelector != nil { + in, out := &in.TopicUrnSelector, &out.TopicUrnSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageDetectionInitParameters. +func (in *MessageDetectionInitParameters) DeepCopy() *MessageDetectionInitParameters { + if in == nil { + return nil + } + out := new(MessageDetectionInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageDetectionList) DeepCopyInto(out *MessageDetectionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MessageDetection, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageDetectionList. +func (in *MessageDetectionList) DeepCopy() *MessageDetectionList { + if in == nil { + return nil + } + out := new(MessageDetectionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MessageDetectionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageDetectionObservation) DeepCopyInto(out *MessageDetectionObservation) { + *out = *in + if in.EnableForceNew != nil { + in, out := &in.EnableForceNew, &out.EnableForceNew + *out = new(string) + **out = **in + } + if in.Endpoint != nil { + in, out := &in.Endpoint, &out.Endpoint + *out = new(string) + **out = **in + } + if in.Extension != nil { + in, out := &in.Extension, &out.Extension + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Result != nil { + in, out := &in.Result, &out.Result + *out = new(string) + **out = **in + } + if in.TopicUrn != nil { + in, out := &in.TopicUrn, &out.TopicUrn + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageDetectionObservation. +func (in *MessageDetectionObservation) DeepCopy() *MessageDetectionObservation { + if in == nil { + return nil + } + out := new(MessageDetectionObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageDetectionParameters) DeepCopyInto(out *MessageDetectionParameters) { + *out = *in + if in.EnableForceNew != nil { + in, out := &in.EnableForceNew, &out.EnableForceNew + *out = new(string) + **out = **in + } + if in.Endpoint != nil { + in, out := &in.Endpoint, &out.Endpoint + *out = new(string) + **out = **in + } + if in.Extension != nil { + in, out := &in.Extension, &out.Extension + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.TopicUrn != nil { + in, out := &in.TopicUrn, &out.TopicUrn + *out = new(string) + **out = **in + } + if in.TopicUrnRef != nil { + in, out := &in.TopicUrnRef, &out.TopicUrnRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.TopicUrnSelector != nil { + in, out := &in.TopicUrnSelector, &out.TopicUrnSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageDetectionParameters. +func (in *MessageDetectionParameters) DeepCopy() *MessageDetectionParameters { + if in == nil { + return nil + } + out := new(MessageDetectionParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageDetectionSpec) DeepCopyInto(out *MessageDetectionSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageDetectionSpec. +func (in *MessageDetectionSpec) DeepCopy() *MessageDetectionSpec { + if in == nil { + return nil + } + out := new(MessageDetectionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageDetectionStatus) DeepCopyInto(out *MessageDetectionStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageDetectionStatus. +func (in *MessageDetectionStatus) DeepCopy() *MessageDetectionStatus { + if in == nil { + return nil + } + out := new(MessageDetectionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessagePublish) DeepCopyInto(out *MessagePublish) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessagePublish. +func (in *MessagePublish) DeepCopy() *MessagePublish { + if in == nil { + return nil + } + out := new(MessagePublish) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MessagePublish) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessagePublishInitParameters) DeepCopyInto(out *MessagePublishInitParameters) { + *out = *in + if in.EnableForceNew != nil { + in, out := &in.EnableForceNew, &out.EnableForceNew + *out = new(string) + **out = **in + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } + if in.MessageAttributes != nil { + in, out := &in.MessageAttributes, &out.MessageAttributes + *out = make([]MessageAttributesInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.MessageStructure != nil { + in, out := &in.MessageStructure, &out.MessageStructure + *out = new(string) + **out = **in + } + if in.MessageTemplateName != nil { + in, out := &in.MessageTemplateName, &out.MessageTemplateName + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Subject != nil { + in, out := &in.Subject, &out.Subject + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.TimeToLive != nil { + in, out := &in.TimeToLive, &out.TimeToLive + *out = new(string) + **out = **in + } + if in.TopicUrn != nil { + in, out := &in.TopicUrn, &out.TopicUrn + *out = new(string) + **out = **in + } + if in.TopicUrnRef != nil { + in, out := &in.TopicUrnRef, &out.TopicUrnRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.TopicUrnSelector != nil { + in, out := &in.TopicUrnSelector, &out.TopicUrnSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessagePublishInitParameters. +func (in *MessagePublishInitParameters) DeepCopy() *MessagePublishInitParameters { + if in == nil { + return nil + } + out := new(MessagePublishInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessagePublishList) DeepCopyInto(out *MessagePublishList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MessagePublish, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessagePublishList. +func (in *MessagePublishList) DeepCopy() *MessagePublishList { + if in == nil { + return nil + } + out := new(MessagePublishList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MessagePublishList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessagePublishObservation) DeepCopyInto(out *MessagePublishObservation) { + *out = *in + if in.EnableForceNew != nil { + in, out := &in.EnableForceNew, &out.EnableForceNew + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } + if in.MessageAttributes != nil { + in, out := &in.MessageAttributes, &out.MessageAttributes + *out = make([]MessageAttributesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.MessageStructure != nil { + in, out := &in.MessageStructure, &out.MessageStructure + *out = new(string) + **out = **in + } + if in.MessageTemplateName != nil { + in, out := &in.MessageTemplateName, &out.MessageTemplateName + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Subject != nil { + in, out := &in.Subject, &out.Subject + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.TimeToLive != nil { + in, out := &in.TimeToLive, &out.TimeToLive + *out = new(string) + **out = **in + } + if in.TopicUrn != nil { + in, out := &in.TopicUrn, &out.TopicUrn + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessagePublishObservation. +func (in *MessagePublishObservation) DeepCopy() *MessagePublishObservation { + if in == nil { + return nil + } + out := new(MessagePublishObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessagePublishParameters) DeepCopyInto(out *MessagePublishParameters) { + *out = *in + if in.EnableForceNew != nil { + in, out := &in.EnableForceNew, &out.EnableForceNew + *out = new(string) + **out = **in + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } + if in.MessageAttributes != nil { + in, out := &in.MessageAttributes, &out.MessageAttributes + *out = make([]MessageAttributesParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.MessageStructure != nil { + in, out := &in.MessageStructure, &out.MessageStructure + *out = new(string) + **out = **in + } + if in.MessageTemplateName != nil { + in, out := &in.MessageTemplateName, &out.MessageTemplateName + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Subject != nil { + in, out := &in.Subject, &out.Subject + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.TimeToLive != nil { + in, out := &in.TimeToLive, &out.TimeToLive + *out = new(string) + **out = **in + } + if in.TopicUrn != nil { + in, out := &in.TopicUrn, &out.TopicUrn + *out = new(string) + **out = **in + } + if in.TopicUrnRef != nil { + in, out := &in.TopicUrnRef, &out.TopicUrnRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.TopicUrnSelector != nil { + in, out := &in.TopicUrnSelector, &out.TopicUrnSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessagePublishParameters. +func (in *MessagePublishParameters) DeepCopy() *MessagePublishParameters { + if in == nil { + return nil + } + out := new(MessagePublishParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessagePublishSpec) DeepCopyInto(out *MessagePublishSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessagePublishSpec. +func (in *MessagePublishSpec) DeepCopy() *MessagePublishSpec { + if in == nil { + return nil + } + out := new(MessagePublishSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessagePublishStatus) DeepCopyInto(out *MessagePublishStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessagePublishStatus. +func (in *MessagePublishStatus) DeepCopy() *MessagePublishStatus { + if in == nil { + return nil + } + out := new(MessagePublishStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageTemplate) DeepCopyInto(out *MessageTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageTemplate. +func (in *MessageTemplate) DeepCopy() *MessageTemplate { + if in == nil { + return nil + } + out := new(MessageTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MessageTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageTemplateInitParameters) DeepCopyInto(out *MessageTemplateInitParameters) { + *out = *in + if in.Content != nil { + in, out := &in.Content, &out.Content + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageTemplateInitParameters. +func (in *MessageTemplateInitParameters) DeepCopy() *MessageTemplateInitParameters { + if in == nil { + return nil + } + out := new(MessageTemplateInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageTemplateList) DeepCopyInto(out *MessageTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MessageTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageTemplateList. +func (in *MessageTemplateList) DeepCopy() *MessageTemplateList { + if in == nil { + return nil + } + out := new(MessageTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MessageTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageTemplateObservation) DeepCopyInto(out *MessageTemplateObservation) { + *out = *in + if in.Content != nil { + in, out := &in.Content, &out.Content + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.TagNames != nil { + in, out := &in.TagNames, &out.TagNames + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageTemplateObservation. +func (in *MessageTemplateObservation) DeepCopy() *MessageTemplateObservation { + if in == nil { + return nil + } + out := new(MessageTemplateObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageTemplateParameters) DeepCopyInto(out *MessageTemplateParameters) { + *out = *in + if in.Content != nil { + in, out := &in.Content, &out.Content + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageTemplateParameters. +func (in *MessageTemplateParameters) DeepCopy() *MessageTemplateParameters { + if in == nil { + return nil + } + out := new(MessageTemplateParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageTemplateSpec) DeepCopyInto(out *MessageTemplateSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageTemplateSpec. +func (in *MessageTemplateSpec) DeepCopy() *MessageTemplateSpec { + if in == nil { + return nil + } + out := new(MessageTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MessageTemplateStatus) DeepCopyInto(out *MessageTemplateStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageTemplateStatus. +func (in *MessageTemplateStatus) DeepCopy() *MessageTemplateStatus { + if in == nil { + return nil + } + out := new(MessageTemplateStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Subscription) DeepCopyInto(out *Subscription) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subscription. +func (in *Subscription) DeepCopy() *Subscription { + if in == nil { + return nil + } + out := new(Subscription) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Subscription) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionFilterPolicy) DeepCopyInto(out *SubscriptionFilterPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionFilterPolicy. +func (in *SubscriptionFilterPolicy) DeepCopy() *SubscriptionFilterPolicy { + if in == nil { + return nil + } + out := new(SubscriptionFilterPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SubscriptionFilterPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionFilterPolicyFilterPoliciesInitParameters) DeepCopyInto(out *SubscriptionFilterPolicyFilterPoliciesInitParameters) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.StringEquals != nil { + in, out := &in.StringEquals, &out.StringEquals + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionFilterPolicyFilterPoliciesInitParameters. +func (in *SubscriptionFilterPolicyFilterPoliciesInitParameters) DeepCopy() *SubscriptionFilterPolicyFilterPoliciesInitParameters { + if in == nil { + return nil + } + out := new(SubscriptionFilterPolicyFilterPoliciesInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionFilterPolicyFilterPoliciesObservation) DeepCopyInto(out *SubscriptionFilterPolicyFilterPoliciesObservation) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.StringEquals != nil { + in, out := &in.StringEquals, &out.StringEquals + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionFilterPolicyFilterPoliciesObservation. +func (in *SubscriptionFilterPolicyFilterPoliciesObservation) DeepCopy() *SubscriptionFilterPolicyFilterPoliciesObservation { + if in == nil { + return nil + } + out := new(SubscriptionFilterPolicyFilterPoliciesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionFilterPolicyFilterPoliciesParameters) DeepCopyInto(out *SubscriptionFilterPolicyFilterPoliciesParameters) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.StringEquals != nil { + in, out := &in.StringEquals, &out.StringEquals + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionFilterPolicyFilterPoliciesParameters. +func (in *SubscriptionFilterPolicyFilterPoliciesParameters) DeepCopy() *SubscriptionFilterPolicyFilterPoliciesParameters { + if in == nil { + return nil + } + out := new(SubscriptionFilterPolicyFilterPoliciesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionFilterPolicyInitParameters) DeepCopyInto(out *SubscriptionFilterPolicyInitParameters) { + *out = *in + if in.EnableForceNew != nil { + in, out := &in.EnableForceNew, &out.EnableForceNew + *out = new(string) + **out = **in + } + if in.FilterPolicies != nil { + in, out := &in.FilterPolicies, &out.FilterPolicies + *out = make([]SubscriptionFilterPolicyFilterPoliciesInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SubscriptionUrn != nil { + in, out := &in.SubscriptionUrn, &out.SubscriptionUrn + *out = new(string) + **out = **in + } + if in.SubscriptionUrnRef != nil { + in, out := &in.SubscriptionUrnRef, &out.SubscriptionUrnRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubscriptionUrnSelector != nil { + in, out := &in.SubscriptionUrnSelector, &out.SubscriptionUrnSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionFilterPolicyInitParameters. +func (in *SubscriptionFilterPolicyInitParameters) DeepCopy() *SubscriptionFilterPolicyInitParameters { + if in == nil { + return nil + } + out := new(SubscriptionFilterPolicyInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionFilterPolicyList) DeepCopyInto(out *SubscriptionFilterPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SubscriptionFilterPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionFilterPolicyList. +func (in *SubscriptionFilterPolicyList) DeepCopy() *SubscriptionFilterPolicyList { + if in == nil { + return nil + } + out := new(SubscriptionFilterPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SubscriptionFilterPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionFilterPolicyObservation) DeepCopyInto(out *SubscriptionFilterPolicyObservation) { + *out = *in + if in.EnableForceNew != nil { + in, out := &in.EnableForceNew, &out.EnableForceNew + *out = new(string) + **out = **in + } + if in.FilterPolicies != nil { + in, out := &in.FilterPolicies, &out.FilterPolicies + *out = make([]SubscriptionFilterPolicyFilterPoliciesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SubscriptionUrn != nil { + in, out := &in.SubscriptionUrn, &out.SubscriptionUrn + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionFilterPolicyObservation. +func (in *SubscriptionFilterPolicyObservation) DeepCopy() *SubscriptionFilterPolicyObservation { + if in == nil { + return nil + } + out := new(SubscriptionFilterPolicyObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionFilterPolicyParameters) DeepCopyInto(out *SubscriptionFilterPolicyParameters) { + *out = *in + if in.EnableForceNew != nil { + in, out := &in.EnableForceNew, &out.EnableForceNew + *out = new(string) + **out = **in + } + if in.FilterPolicies != nil { + in, out := &in.FilterPolicies, &out.FilterPolicies + *out = make([]SubscriptionFilterPolicyFilterPoliciesParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SubscriptionUrn != nil { + in, out := &in.SubscriptionUrn, &out.SubscriptionUrn + *out = new(string) + **out = **in + } + if in.SubscriptionUrnRef != nil { + in, out := &in.SubscriptionUrnRef, &out.SubscriptionUrnRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubscriptionUrnSelector != nil { + in, out := &in.SubscriptionUrnSelector, &out.SubscriptionUrnSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionFilterPolicyParameters. +func (in *SubscriptionFilterPolicyParameters) DeepCopy() *SubscriptionFilterPolicyParameters { + if in == nil { + return nil + } + out := new(SubscriptionFilterPolicyParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionFilterPolicySpec) DeepCopyInto(out *SubscriptionFilterPolicySpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionFilterPolicySpec. +func (in *SubscriptionFilterPolicySpec) DeepCopy() *SubscriptionFilterPolicySpec { + if in == nil { + return nil + } + out := new(SubscriptionFilterPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionFilterPolicyStatus) DeepCopyInto(out *SubscriptionFilterPolicyStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionFilterPolicyStatus. +func (in *SubscriptionFilterPolicyStatus) DeepCopy() *SubscriptionFilterPolicyStatus { + if in == nil { + return nil + } + out := new(SubscriptionFilterPolicyStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionInitParameters) DeepCopyInto(out *SubscriptionInitParameters) { + *out = *in + if in.Endpoint != nil { + in, out := &in.Endpoint, &out.Endpoint + *out = new(string) + **out = **in + } + if in.Extension != nil { + in, out := &in.Extension, &out.Extension + *out = make([]ExtensionInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Remark != nil { + in, out := &in.Remark, &out.Remark + *out = new(string) + **out = **in + } + if in.TopicUrn != nil { + in, out := &in.TopicUrn, &out.TopicUrn + *out = new(string) + **out = **in + } + if in.TopicUrnRef != nil { + in, out := &in.TopicUrnRef, &out.TopicUrnRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.TopicUrnSelector != nil { + in, out := &in.TopicUrnSelector, &out.TopicUrnSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionInitParameters. +func (in *SubscriptionInitParameters) DeepCopy() *SubscriptionInitParameters { + if in == nil { + return nil + } + out := new(SubscriptionInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionList) DeepCopyInto(out *SubscriptionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Subscription, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionList. +func (in *SubscriptionList) DeepCopy() *SubscriptionList { + if in == nil { + return nil + } + out := new(SubscriptionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SubscriptionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionObservation) DeepCopyInto(out *SubscriptionObservation) { + *out = *in + if in.Endpoint != nil { + in, out := &in.Endpoint, &out.Endpoint + *out = new(string) + **out = **in + } + if in.Extension != nil { + in, out := &in.Extension, &out.Extension + *out = make([]ExtensionObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.FilterPolicies != nil { + in, out := &in.FilterPolicies, &out.FilterPolicies + *out = make([]FilterPoliciesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Remark != nil { + in, out := &in.Remark, &out.Remark + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(float64) + **out = **in + } + if in.SubscriptionUrn != nil { + in, out := &in.SubscriptionUrn, &out.SubscriptionUrn + *out = new(string) + **out = **in + } + if in.TopicUrn != nil { + in, out := &in.TopicUrn, &out.TopicUrn + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionObservation. +func (in *SubscriptionObservation) DeepCopy() *SubscriptionObservation { + if in == nil { + return nil + } + out := new(SubscriptionObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionParameters) DeepCopyInto(out *SubscriptionParameters) { + *out = *in + if in.Endpoint != nil { + in, out := &in.Endpoint, &out.Endpoint + *out = new(string) + **out = **in + } + if in.Extension != nil { + in, out := &in.Extension, &out.Extension + *out = make([]ExtensionParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Remark != nil { + in, out := &in.Remark, &out.Remark + *out = new(string) + **out = **in + } + if in.TopicUrn != nil { + in, out := &in.TopicUrn, &out.TopicUrn + *out = new(string) + **out = **in + } + if in.TopicUrnRef != nil { + in, out := &in.TopicUrnRef, &out.TopicUrnRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.TopicUrnSelector != nil { + in, out := &in.TopicUrnSelector, &out.TopicUrnSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionParameters. +func (in *SubscriptionParameters) DeepCopy() *SubscriptionParameters { + if in == nil { + return nil + } + out := new(SubscriptionParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionSpec) DeepCopyInto(out *SubscriptionSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionSpec. +func (in *SubscriptionSpec) DeepCopy() *SubscriptionSpec { + if in == nil { + return nil + } + out := new(SubscriptionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionStatus) DeepCopyInto(out *SubscriptionStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionStatus. +func (in *SubscriptionStatus) DeepCopy() *SubscriptionStatus { + if in == nil { + return nil + } + out := new(SubscriptionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Topic) DeepCopyInto(out *Topic) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Topic. +func (in *Topic) DeepCopy() *Topic { + if in == nil { + return nil + } + out := new(Topic) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Topic) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TopicInitParameters) DeepCopyInto(out *TopicInitParameters) { + *out = *in + if in.AccessPolicy != nil { + in, out := &in.AccessPolicy, &out.AccessPolicy + *out = new(string) + **out = **in + } + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.EnterpriseProjectID != nil { + in, out := &in.EnterpriseProjectID, &out.EnterpriseProjectID + *out = new(string) + **out = **in + } + if in.Introduction != nil { + in, out := &in.Introduction, &out.Introduction + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ServicesPublishAllowed != nil { + in, out := &in.ServicesPublishAllowed, &out.ServicesPublishAllowed + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.UsersPublishAllowed != nil { + in, out := &in.UsersPublishAllowed, &out.UsersPublishAllowed + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopicInitParameters. +func (in *TopicInitParameters) DeepCopy() *TopicInitParameters { + if in == nil { + return nil + } + out := new(TopicInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TopicList) DeepCopyInto(out *TopicList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Topic, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopicList. +func (in *TopicList) DeepCopy() *TopicList { + if in == nil { + return nil + } + out := new(TopicList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TopicList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TopicObservation) DeepCopyInto(out *TopicObservation) { + *out = *in + if in.AccessPolicy != nil { + in, out := &in.AccessPolicy, &out.AccessPolicy + *out = new(string) + **out = **in + } + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.EnterpriseProjectID != nil { + in, out := &in.EnterpriseProjectID, &out.EnterpriseProjectID + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Introduction != nil { + in, out := &in.Introduction, &out.Introduction + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PushPolicy != nil { + in, out := &in.PushPolicy, &out.PushPolicy + *out = new(float64) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ServicesPublishAllowed != nil { + in, out := &in.ServicesPublishAllowed, &out.ServicesPublishAllowed + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.TopicUrn != nil { + in, out := &in.TopicUrn, &out.TopicUrn + *out = new(string) + **out = **in + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } + if in.UsersPublishAllowed != nil { + in, out := &in.UsersPublishAllowed, &out.UsersPublishAllowed + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopicObservation. +func (in *TopicObservation) DeepCopy() *TopicObservation { + if in == nil { + return nil + } + out := new(TopicObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TopicParameters) DeepCopyInto(out *TopicParameters) { + *out = *in + if in.AccessPolicy != nil { + in, out := &in.AccessPolicy, &out.AccessPolicy + *out = new(string) + **out = **in + } + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.EnterpriseProjectID != nil { + in, out := &in.EnterpriseProjectID, &out.EnterpriseProjectID + *out = new(string) + **out = **in + } + if in.Introduction != nil { + in, out := &in.Introduction, &out.Introduction + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ServicesPublishAllowed != nil { + in, out := &in.ServicesPublishAllowed, &out.ServicesPublishAllowed + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.UsersPublishAllowed != nil { + in, out := &in.UsersPublishAllowed, &out.UsersPublishAllowed + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopicParameters. +func (in *TopicParameters) DeepCopy() *TopicParameters { + if in == nil { + return nil + } + out := new(TopicParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TopicSpec) DeepCopyInto(out *TopicSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopicSpec. +func (in *TopicSpec) DeepCopy() *TopicSpec { + if in == nil { + return nil + } + out := new(TopicSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TopicStatus) DeepCopyInto(out *TopicStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopicStatus. +func (in *TopicStatus) DeepCopy() *TopicStatus { + if in == nil { + return nil + } + out := new(TopicStatus) + in.DeepCopyInto(out) + return out +} diff --git a/apis/smn/v1alpha1/zz_generated.managed.go b/apis/smn/v1alpha1/zz_generated.managed.go new file mode 100644 index 0000000..3be5021 --- /dev/null +++ b/apis/smn/v1alpha1/zz_generated.managed.go @@ -0,0 +1,429 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + +// GetCondition of this Logtank. +func (mg *Logtank) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Logtank. +func (mg *Logtank) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this Logtank. +func (mg *Logtank) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this Logtank. +func (mg *Logtank) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this Logtank. +func (mg *Logtank) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Logtank. +func (mg *Logtank) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Logtank. +func (mg *Logtank) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Logtank. +func (mg *Logtank) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this Logtank. +func (mg *Logtank) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this Logtank. +func (mg *Logtank) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this Logtank. +func (mg *Logtank) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Logtank. +func (mg *Logtank) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this MessageDetection. +func (mg *MessageDetection) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this MessageDetection. +func (mg *MessageDetection) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this MessageDetection. +func (mg *MessageDetection) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this MessageDetection. +func (mg *MessageDetection) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this MessageDetection. +func (mg *MessageDetection) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this MessageDetection. +func (mg *MessageDetection) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this MessageDetection. +func (mg *MessageDetection) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this MessageDetection. +func (mg *MessageDetection) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this MessageDetection. +func (mg *MessageDetection) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this MessageDetection. +func (mg *MessageDetection) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this MessageDetection. +func (mg *MessageDetection) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this MessageDetection. +func (mg *MessageDetection) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this MessagePublish. +func (mg *MessagePublish) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this MessagePublish. +func (mg *MessagePublish) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this MessagePublish. +func (mg *MessagePublish) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this MessagePublish. +func (mg *MessagePublish) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this MessagePublish. +func (mg *MessagePublish) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this MessagePublish. +func (mg *MessagePublish) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this MessagePublish. +func (mg *MessagePublish) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this MessagePublish. +func (mg *MessagePublish) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this MessagePublish. +func (mg *MessagePublish) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this MessagePublish. +func (mg *MessagePublish) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this MessagePublish. +func (mg *MessagePublish) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this MessagePublish. +func (mg *MessagePublish) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this MessageTemplate. +func (mg *MessageTemplate) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this MessageTemplate. +func (mg *MessageTemplate) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this MessageTemplate. +func (mg *MessageTemplate) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this MessageTemplate. +func (mg *MessageTemplate) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this MessageTemplate. +func (mg *MessageTemplate) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this MessageTemplate. +func (mg *MessageTemplate) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this MessageTemplate. +func (mg *MessageTemplate) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this MessageTemplate. +func (mg *MessageTemplate) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this MessageTemplate. +func (mg *MessageTemplate) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this MessageTemplate. +func (mg *MessageTemplate) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this MessageTemplate. +func (mg *MessageTemplate) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this MessageTemplate. +func (mg *MessageTemplate) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this Subscription. +func (mg *Subscription) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Subscription. +func (mg *Subscription) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this Subscription. +func (mg *Subscription) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this Subscription. +func (mg *Subscription) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this Subscription. +func (mg *Subscription) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Subscription. +func (mg *Subscription) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Subscription. +func (mg *Subscription) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Subscription. +func (mg *Subscription) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this Subscription. +func (mg *Subscription) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this Subscription. +func (mg *Subscription) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this Subscription. +func (mg *Subscription) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Subscription. +func (mg *Subscription) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this SubscriptionFilterPolicy. +func (mg *SubscriptionFilterPolicy) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this SubscriptionFilterPolicy. +func (mg *SubscriptionFilterPolicy) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this SubscriptionFilterPolicy. +func (mg *SubscriptionFilterPolicy) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this SubscriptionFilterPolicy. +func (mg *SubscriptionFilterPolicy) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this SubscriptionFilterPolicy. +func (mg *SubscriptionFilterPolicy) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this SubscriptionFilterPolicy. +func (mg *SubscriptionFilterPolicy) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this SubscriptionFilterPolicy. +func (mg *SubscriptionFilterPolicy) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this SubscriptionFilterPolicy. +func (mg *SubscriptionFilterPolicy) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this SubscriptionFilterPolicy. +func (mg *SubscriptionFilterPolicy) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this SubscriptionFilterPolicy. +func (mg *SubscriptionFilterPolicy) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this SubscriptionFilterPolicy. +func (mg *SubscriptionFilterPolicy) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this SubscriptionFilterPolicy. +func (mg *SubscriptionFilterPolicy) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this Topic. +func (mg *Topic) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Topic. +func (mg *Topic) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this Topic. +func (mg *Topic) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this Topic. +func (mg *Topic) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this Topic. +func (mg *Topic) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Topic. +func (mg *Topic) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Topic. +func (mg *Topic) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Topic. +func (mg *Topic) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this Topic. +func (mg *Topic) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this Topic. +func (mg *Topic) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this Topic. +func (mg *Topic) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Topic. +func (mg *Topic) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/smn/v1alpha1/zz_generated.managedlist.go b/apis/smn/v1alpha1/zz_generated.managedlist.go new file mode 100644 index 0000000..56afbe1 --- /dev/null +++ b/apis/smn/v1alpha1/zz_generated.managedlist.go @@ -0,0 +1,72 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import resource "github.com/crossplane/crossplane-runtime/pkg/resource" + +// GetItems of this LogtankList. +func (l *LogtankList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + +// GetItems of this MessageDetectionList. +func (l *MessageDetectionList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + +// GetItems of this MessagePublishList. +func (l *MessagePublishList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + +// GetItems of this MessageTemplateList. +func (l *MessageTemplateList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + +// GetItems of this SubscriptionFilterPolicyList. +func (l *SubscriptionFilterPolicyList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + +// GetItems of this SubscriptionList. +func (l *SubscriptionList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + +// GetItems of this TopicList. +func (l *TopicList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} diff --git a/apis/smn/v1alpha1/zz_generated.resolvers.go b/apis/smn/v1alpha1/zz_generated.resolvers.go new file mode 100644 index 0000000..ff62dca --- /dev/null +++ b/apis/smn/v1alpha1/zz_generated.resolvers.go @@ -0,0 +1,225 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + resource "github.com/crossplane/upjet/pkg/resource" + errors "github.com/pkg/errors" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// ResolveReferences of this Logtank. +func (mg *Logtank) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.TopicUrn), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.TopicUrnRef, + Selector: mg.Spec.ForProvider.TopicUrnSelector, + To: reference.To{ + List: &TopicList{}, + Managed: &Topic{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.TopicUrn") + } + mg.Spec.ForProvider.TopicUrn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.TopicUrnRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.TopicUrn), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.TopicUrnRef, + Selector: mg.Spec.InitProvider.TopicUrnSelector, + To: reference.To{ + List: &TopicList{}, + Managed: &Topic{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.TopicUrn") + } + mg.Spec.InitProvider.TopicUrn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.TopicUrnRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this MessageDetection. +func (mg *MessageDetection) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.TopicUrn), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.TopicUrnRef, + Selector: mg.Spec.ForProvider.TopicUrnSelector, + To: reference.To{ + List: &TopicList{}, + Managed: &Topic{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.TopicUrn") + } + mg.Spec.ForProvider.TopicUrn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.TopicUrnRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.TopicUrn), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.TopicUrnRef, + Selector: mg.Spec.InitProvider.TopicUrnSelector, + To: reference.To{ + List: &TopicList{}, + Managed: &Topic{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.TopicUrn") + } + mg.Spec.InitProvider.TopicUrn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.TopicUrnRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this MessagePublish. +func (mg *MessagePublish) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.TopicUrn), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.TopicUrnRef, + Selector: mg.Spec.ForProvider.TopicUrnSelector, + To: reference.To{ + List: &TopicList{}, + Managed: &Topic{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.TopicUrn") + } + mg.Spec.ForProvider.TopicUrn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.TopicUrnRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.TopicUrn), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.TopicUrnRef, + Selector: mg.Spec.InitProvider.TopicUrnSelector, + To: reference.To{ + List: &TopicList{}, + Managed: &Topic{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.TopicUrn") + } + mg.Spec.InitProvider.TopicUrn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.TopicUrnRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this Subscription. +func (mg *Subscription) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.TopicUrn), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.TopicUrnRef, + Selector: mg.Spec.ForProvider.TopicUrnSelector, + To: reference.To{ + List: &TopicList{}, + Managed: &Topic{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.TopicUrn") + } + mg.Spec.ForProvider.TopicUrn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.TopicUrnRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.TopicUrn), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.TopicUrnRef, + Selector: mg.Spec.InitProvider.TopicUrnSelector, + To: reference.To{ + List: &TopicList{}, + Managed: &Topic{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.TopicUrn") + } + mg.Spec.InitProvider.TopicUrn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.TopicUrnRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this SubscriptionFilterPolicy. +func (mg *SubscriptionFilterPolicy) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.SubscriptionUrn), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.SubscriptionUrnRef, + Selector: mg.Spec.ForProvider.SubscriptionUrnSelector, + To: reference.To{ + List: &SubscriptionList{}, + Managed: &Subscription{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.SubscriptionUrn") + } + mg.Spec.ForProvider.SubscriptionUrn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.SubscriptionUrnRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.SubscriptionUrn), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.SubscriptionUrnRef, + Selector: mg.Spec.InitProvider.SubscriptionUrnSelector, + To: reference.To{ + List: &SubscriptionList{}, + Managed: &Subscription{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.SubscriptionUrn") + } + mg.Spec.InitProvider.SubscriptionUrn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.SubscriptionUrnRef = rsp.ResolvedReference + + return nil +} diff --git a/apis/smn/v1alpha1/zz_groupversion_info.go b/apis/smn/v1alpha1/zz_groupversion_info.go new file mode 100755 index 0000000..950e1b2 --- /dev/null +++ b/apis/smn/v1alpha1/zz_groupversion_info.go @@ -0,0 +1,32 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +// +kubebuilder:object:generate=true +// +groupName=smn.huaweicloud.crossplane.io +// +versionName=v1alpha1 +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +// Package type metadata. +const ( + CRDGroup = "smn.huaweicloud.crossplane.io" + CRDVersion = "v1alpha1" +) + +var ( + // CRDGroupVersion is the API Group Version used to register the objects + CRDGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: CRDGroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/apis/smn/v1alpha1/zz_logtank_terraformed.go b/apis/smn/v1alpha1/zz_logtank_terraformed.go new file mode 100755 index 0000000..cae91bd --- /dev/null +++ b/apis/smn/v1alpha1/zz_logtank_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this Logtank +func (mg *Logtank) GetTerraformResourceType() string { + return "huaweicloud_smn_logtank" +} + +// GetConnectionDetailsMapping for this Logtank +func (tr *Logtank) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Logtank +func (tr *Logtank) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this Logtank +func (tr *Logtank) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this Logtank +func (tr *Logtank) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Logtank +func (tr *Logtank) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this Logtank +func (tr *Logtank) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this Logtank +func (tr *Logtank) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this Logtank +func (tr *Logtank) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this Logtank using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Logtank) LateInitialize(attrs []byte) (bool, error) { + params := &LogtankParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *Logtank) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/smn/v1alpha1/zz_logtank_types.go b/apis/smn/v1alpha1/zz_logtank_types.go new file mode 100755 index 0000000..612782b --- /dev/null +++ b/apis/smn/v1alpha1/zz_logtank_types.go @@ -0,0 +1,164 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type LogtankInitParameters struct { + + // The lts log group ID. + LogGroupID *string `json:"logGroupId,omitempty" tf:"log_group_id,omitempty"` + + // The lts log stream ID. + LogStreamID *string `json:"logStreamId,omitempty" tf:"log_stream_id,omitempty"` + + // The region in which to create the SMN logtank resource. If omitted, the + // provider-level region will be used. Changing this parameter will create a new resource. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Resource identifier of a topic, which is unique. + // Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1.Topic + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + TopicUrn *string `json:"topicUrn,omitempty" tf:"topic_urn,omitempty"` + + // Reference to a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnRef *v1.Reference `json:"topicUrnRef,omitempty" tf:"-"` + + // Selector for a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnSelector *v1.Selector `json:"topicUrnSelector,omitempty" tf:"-"` +} + +type LogtankObservation struct { + + // Time when the logtank was created. + CreatedAt *string `json:"createdAt,omitempty" tf:"created_at,omitempty"` + + // The resource ID. The value is the topic URN. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The lts log group ID. + LogGroupID *string `json:"logGroupId,omitempty" tf:"log_group_id,omitempty"` + + // The lts log stream ID. + LogStreamID *string `json:"logStreamId,omitempty" tf:"log_stream_id,omitempty"` + + // The ID of the logtank. + LogtankID *string `json:"logtankId,omitempty" tf:"logtank_id,omitempty"` + + // The region in which to create the SMN logtank resource. If omitted, the + // provider-level region will be used. Changing this parameter will create a new resource. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Resource identifier of a topic, which is unique. + // Changing this parameter will create a new resource. + TopicUrn *string `json:"topicUrn,omitempty" tf:"topic_urn,omitempty"` + + // Time when the logtank was updated. + UpdatedAt *string `json:"updatedAt,omitempty" tf:"updated_at,omitempty"` +} + +type LogtankParameters struct { + + // The lts log group ID. + // +kubebuilder:validation:Optional + LogGroupID *string `json:"logGroupId,omitempty" tf:"log_group_id,omitempty"` + + // The lts log stream ID. + // +kubebuilder:validation:Optional + LogStreamID *string `json:"logStreamId,omitempty" tf:"log_stream_id,omitempty"` + + // The region in which to create the SMN logtank resource. If omitted, the + // provider-level region will be used. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Resource identifier of a topic, which is unique. + // Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1.Topic + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + TopicUrn *string `json:"topicUrn,omitempty" tf:"topic_urn,omitempty"` + + // Reference to a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnRef *v1.Reference `json:"topicUrnRef,omitempty" tf:"-"` + + // Selector for a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnSelector *v1.Selector `json:"topicUrnSelector,omitempty" tf:"-"` +} + +// LogtankSpec defines the desired state of Logtank +type LogtankSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider LogtankParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider LogtankInitParameters `json:"initProvider,omitempty"` +} + +// LogtankStatus defines the observed state of Logtank. +type LogtankStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider LogtankObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// Logtank is the Schema for the Logtanks API. "" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,huaweicloud} +type Logtank struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.logGroupId) || (has(self.initProvider) && has(self.initProvider.logGroupId))",message="spec.forProvider.logGroupId is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.logStreamId) || (has(self.initProvider) && has(self.initProvider.logStreamId))",message="spec.forProvider.logStreamId is a required parameter" + Spec LogtankSpec `json:"spec"` + Status LogtankStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// LogtankList contains a list of Logtanks +type LogtankList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Logtank `json:"items"` +} + +// Repository type metadata. +var ( + Logtank_Kind = "Logtank" + Logtank_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Logtank_Kind}.String() + Logtank_KindAPIVersion = Logtank_Kind + "." + CRDGroupVersion.String() + Logtank_GroupVersionKind = CRDGroupVersion.WithKind(Logtank_Kind) +) + +func init() { + SchemeBuilder.Register(&Logtank{}, &LogtankList{}) +} diff --git a/apis/smn/v1alpha1/zz_messagedetection_terraformed.go b/apis/smn/v1alpha1/zz_messagedetection_terraformed.go new file mode 100755 index 0000000..ef3a9de --- /dev/null +++ b/apis/smn/v1alpha1/zz_messagedetection_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this MessageDetection +func (mg *MessageDetection) GetTerraformResourceType() string { + return "huaweicloud_smn_message_detection" +} + +// GetConnectionDetailsMapping for this MessageDetection +func (tr *MessageDetection) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this MessageDetection +func (tr *MessageDetection) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this MessageDetection +func (tr *MessageDetection) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this MessageDetection +func (tr *MessageDetection) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this MessageDetection +func (tr *MessageDetection) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this MessageDetection +func (tr *MessageDetection) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this MessageDetection +func (tr *MessageDetection) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this MessageDetection +func (tr *MessageDetection) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this MessageDetection using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *MessageDetection) LateInitialize(attrs []byte) (bool, error) { + params := &MessageDetectionParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *MessageDetection) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/smn/v1alpha1/zz_messagedetection_types.go b/apis/smn/v1alpha1/zz_messagedetection_types.go new file mode 100755 index 0000000..fac613b --- /dev/null +++ b/apis/smn/v1alpha1/zz_messagedetection_types.go @@ -0,0 +1,198 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type MessageDetectionInitParameters struct { + EnableForceNew *string `json:"enableForceNew,omitempty" tf:"enable_force_new,omitempty"` + + // Specifies the endpoint address to be detected. + // The address must start with http:// or https:// and cannot be left blank. + // Specifies the endpoint address to be detected. + Endpoint *string `json:"endpoint,omitempty" tf:"endpoint,omitempty"` + + // Specifies the extended key/value for subscriptions over HTTP or HTTPS. + // These key/value pairs will be carried as the request header when HTTP or HTTPS messages are sent. + // The key/value must meet the following requirements: + // Specifies the extended key/value for subscriptions over HTTP or HTTPS. + // +mapType=granular + Extension map[string]*string `json:"extension,omitempty" tf:"extension,omitempty"` + + // Specifies the protocol type. The value can be http or https. + // Specifies the protocol type. + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // Specifies the region in which to create the resource. + // If omitted, the provider-level region will be used. + // Changing this creates a new resource. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the resource identifier of a topic. + // Specifies the resource identifier of a topic. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1.Topic + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + TopicUrn *string `json:"topicUrn,omitempty" tf:"topic_urn,omitempty"` + + // Reference to a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnRef *v1.Reference `json:"topicUrnRef,omitempty" tf:"-"` + + // Selector for a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnSelector *v1.Selector `json:"topicUrnSelector,omitempty" tf:"-"` +} + +type MessageDetectionObservation struct { + EnableForceNew *string `json:"enableForceNew,omitempty" tf:"enable_force_new,omitempty"` + + // Specifies the endpoint address to be detected. + // The address must start with http:// or https:// and cannot be left blank. + // Specifies the endpoint address to be detected. + Endpoint *string `json:"endpoint,omitempty" tf:"endpoint,omitempty"` + + // Specifies the extended key/value for subscriptions over HTTP or HTTPS. + // These key/value pairs will be carried as the request header when HTTP or HTTPS messages are sent. + // The key/value must meet the following requirements: + // Specifies the extended key/value for subscriptions over HTTP or HTTPS. + // +mapType=granular + Extension map[string]*string `json:"extension,omitempty" tf:"extension,omitempty"` + + // The resource ID. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Specifies the protocol type. The value can be http or https. + // Specifies the protocol type. + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // Specifies the region in which to create the resource. + // If omitted, the provider-level region will be used. + // Changing this creates a new resource. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // The message detection result. + // The message detection result. + Result *string `json:"result,omitempty" tf:"result,omitempty"` + + // Specifies the resource identifier of a topic. + // Specifies the resource identifier of a topic. + TopicUrn *string `json:"topicUrn,omitempty" tf:"topic_urn,omitempty"` +} + +type MessageDetectionParameters struct { + + // +kubebuilder:validation:Optional + EnableForceNew *string `json:"enableForceNew,omitempty" tf:"enable_force_new,omitempty"` + + // Specifies the endpoint address to be detected. + // The address must start with http:// or https:// and cannot be left blank. + // Specifies the endpoint address to be detected. + // +kubebuilder:validation:Optional + Endpoint *string `json:"endpoint,omitempty" tf:"endpoint,omitempty"` + + // Specifies the extended key/value for subscriptions over HTTP or HTTPS. + // These key/value pairs will be carried as the request header when HTTP or HTTPS messages are sent. + // The key/value must meet the following requirements: + // Specifies the extended key/value for subscriptions over HTTP or HTTPS. + // +kubebuilder:validation:Optional + // +mapType=granular + Extension map[string]*string `json:"extension,omitempty" tf:"extension,omitempty"` + + // Specifies the protocol type. The value can be http or https. + // Specifies the protocol type. + // +kubebuilder:validation:Optional + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // Specifies the region in which to create the resource. + // If omitted, the provider-level region will be used. + // Changing this creates a new resource. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the resource identifier of a topic. + // Specifies the resource identifier of a topic. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1.Topic + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + TopicUrn *string `json:"topicUrn,omitempty" tf:"topic_urn,omitempty"` + + // Reference to a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnRef *v1.Reference `json:"topicUrnRef,omitempty" tf:"-"` + + // Selector for a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnSelector *v1.Selector `json:"topicUrnSelector,omitempty" tf:"-"` +} + +// MessageDetectionSpec defines the desired state of MessageDetection +type MessageDetectionSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider MessageDetectionParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider MessageDetectionInitParameters `json:"initProvider,omitempty"` +} + +// MessageDetectionStatus defines the observed state of MessageDetection. +type MessageDetectionStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider MessageDetectionObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// MessageDetection is the Schema for the MessageDetections API. Manages a SMN message detection resource within HuaweiCloud. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,huaweicloud} +type MessageDetection struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.endpoint) || (has(self.initProvider) && has(self.initProvider.endpoint))",message="spec.forProvider.endpoint is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.protocol) || (has(self.initProvider) && has(self.initProvider.protocol))",message="spec.forProvider.protocol is a required parameter" + Spec MessageDetectionSpec `json:"spec"` + Status MessageDetectionStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// MessageDetectionList contains a list of MessageDetections +type MessageDetectionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []MessageDetection `json:"items"` +} + +// Repository type metadata. +var ( + MessageDetection_Kind = "MessageDetection" + MessageDetection_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: MessageDetection_Kind}.String() + MessageDetection_KindAPIVersion = MessageDetection_Kind + "." + CRDGroupVersion.String() + MessageDetection_GroupVersionKind = CRDGroupVersion.WithKind(MessageDetection_Kind) +) + +func init() { + SchemeBuilder.Register(&MessageDetection{}, &MessageDetectionList{}) +} diff --git a/apis/smn/v1alpha1/zz_messagepublish_terraformed.go b/apis/smn/v1alpha1/zz_messagepublish_terraformed.go new file mode 100755 index 0000000..25abc76 --- /dev/null +++ b/apis/smn/v1alpha1/zz_messagepublish_terraformed.go @@ -0,0 +1,136 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this MessagePublish +func (mg *MessagePublish) GetTerraformResourceType() string { + return "huaweicloud_smn_message_publish" +} + +// GetConnectionDetailsMapping for this MessagePublish +func (tr *MessagePublish) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this MessagePublish +func (tr *MessagePublish) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this MessagePublish +func (tr *MessagePublish) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this MessagePublish +func (tr *MessagePublish) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this MessagePublish +func (tr *MessagePublish) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this MessagePublish +func (tr *MessagePublish) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this MessagePublish +func (tr *MessagePublish) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this MessagePublish +func (tr *MessagePublish) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this MessagePublish using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *MessagePublish) LateInitialize(attrs []byte) (bool, error) { + params := &MessagePublishParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + initParams, err := tr.GetInitParameters() + if err != nil { + return false, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + opts = append(opts, resource.WithConditionalFilter("Message", initParams)) + opts = append(opts, resource.WithConditionalFilter("MessageStructure", initParams)) + opts = append(opts, resource.WithConditionalFilter("MessageTemplateName", initParams)) + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *MessagePublish) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/smn/v1alpha1/zz_messagepublish_types.go b/apis/smn/v1alpha1/zz_messagepublish_types.go new file mode 100755 index 0000000..f3236ee --- /dev/null +++ b/apis/smn/v1alpha1/zz_messagepublish_types.go @@ -0,0 +1,329 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type MessageAttributesInitParameters struct { + + // Specifies the property name. + // Specifies the property name. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Specifies the property type. + // The value can be STRING, STRING_ARRAY or PROTOCOL. + // Specifies the property type. + Type *string `json:"type,omitempty" tf:"type,omitempty"` + + // Specifies the property value. + // This parameter is valid only when the type set to STRING. The attribute value can only contain Chinese + // and English, numbers, and underscores, and the length is 1 to 32 characters. + // Specifies the property value. + Value *string `json:"value,omitempty" tf:"value,omitempty"` + + // Specifies the property values. + // This parameter is valid when the type set to STRING_ARRAY or PROTOCOL. + // Specifies the property values. + Values []*string `json:"values,omitempty" tf:"values,omitempty"` +} + +type MessageAttributesObservation struct { + + // Specifies the property name. + // Specifies the property name. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Specifies the property type. + // The value can be STRING, STRING_ARRAY or PROTOCOL. + // Specifies the property type. + Type *string `json:"type,omitempty" tf:"type,omitempty"` + + // Specifies the property value. + // This parameter is valid only when the type set to STRING. The attribute value can only contain Chinese + // and English, numbers, and underscores, and the length is 1 to 32 characters. + // Specifies the property value. + Value *string `json:"value,omitempty" tf:"value,omitempty"` + + // Specifies the property values. + // This parameter is valid when the type set to STRING_ARRAY or PROTOCOL. + // Specifies the property values. + Values []*string `json:"values,omitempty" tf:"values,omitempty"` +} + +type MessageAttributesParameters struct { + + // Specifies the property name. + // Specifies the property name. + // +kubebuilder:validation:Optional + Name *string `json:"name" tf:"name,omitempty"` + + // Specifies the property type. + // The value can be STRING, STRING_ARRAY or PROTOCOL. + // Specifies the property type. + // +kubebuilder:validation:Optional + Type *string `json:"type" tf:"type,omitempty"` + + // Specifies the property value. + // This parameter is valid only when the type set to STRING. The attribute value can only contain Chinese + // and English, numbers, and underscores, and the length is 1 to 32 characters. + // Specifies the property value. + // +kubebuilder:validation:Optional + Value *string `json:"value,omitempty" tf:"value,omitempty"` + + // Specifies the property values. + // This parameter is valid when the type set to STRING_ARRAY or PROTOCOL. + // Specifies the property values. + // +kubebuilder:validation:Optional + Values []*string `json:"values,omitempty" tf:"values,omitempty"` +} + +type MessagePublishInitParameters struct { + EnableForceNew *string `json:"enableForceNew,omitempty" tf:"enable_force_new,omitempty"` + + // Specifies the message content. + // Specifies the message content. + Message *string `json:"message,omitempty" tf:"message,omitempty"` + + // Specifies the message filter policies of a subscriber. + // The message_attributes structure is documented below. + // Specifies the message filter policies of a subscriber. + MessageAttributes []MessageAttributesInitParameters `json:"messageAttributes,omitempty" tf:"message_attributes,omitempty"` + + // Specifies the message structure. + // Specifies the message structure. + MessageStructure *string `json:"messageStructure,omitempty" tf:"message_structure,omitempty"` + + // Specifies the message template name. + // Specifies the message template name. + MessageTemplateName *string `json:"messageTemplateName,omitempty" tf:"message_template_name,omitempty"` + + // Specifies the region in which to create the resource. + // If omitted, the provider-level region will be used. + // Changing this creates a new resource. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the message title. + // Specifies the message title. + Subject *string `json:"subject,omitempty" tf:"subject,omitempty"` + + // Specifies a dictionary consisting of tag and parameters to replace the tag. + // The value corresponding to the label in the message template. Message publishing using message template mode must + // carry this parameter. The key in the dictionary is the parameter name in the message template, which should not + // exceed 21 characters. The value in the dictionary is the value after replacing the parameters in the message + // template, which does not exceed 1KB. + // Specifies a dictionary consisting of tag and parameters to replace the tag. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // Specifies the maximum retention time of the message within the SMN system. + // After this retention time, the system will no longer send the message. The unit is second, and the default value + // of the variable is 3600 second. The value is a positive integer and less than or equal to 3600*24. + // Specifies the maximum retention time of the message within the SMN system. + TimeToLive *string `json:"timeToLive,omitempty" tf:"time_to_live,omitempty"` + + // Specifies the resource identifier of a topic. + // Specifies the resource identifier of a topic. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1.Topic + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + TopicUrn *string `json:"topicUrn,omitempty" tf:"topic_urn,omitempty"` + + // Reference to a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnRef *v1.Reference `json:"topicUrnRef,omitempty" tf:"-"` + + // Selector for a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnSelector *v1.Selector `json:"topicUrnSelector,omitempty" tf:"-"` +} + +type MessagePublishObservation struct { + EnableForceNew *string `json:"enableForceNew,omitempty" tf:"enable_force_new,omitempty"` + + // The resource ID. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Specifies the message content. + // Specifies the message content. + Message *string `json:"message,omitempty" tf:"message,omitempty"` + + // Specifies the message filter policies of a subscriber. + // The message_attributes structure is documented below. + // Specifies the message filter policies of a subscriber. + MessageAttributes []MessageAttributesObservation `json:"messageAttributes,omitempty" tf:"message_attributes,omitempty"` + + // Specifies the message structure. + // Specifies the message structure. + MessageStructure *string `json:"messageStructure,omitempty" tf:"message_structure,omitempty"` + + // Specifies the message template name. + // Specifies the message template name. + MessageTemplateName *string `json:"messageTemplateName,omitempty" tf:"message_template_name,omitempty"` + + // Specifies the region in which to create the resource. + // If omitted, the provider-level region will be used. + // Changing this creates a new resource. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the message title. + // Specifies the message title. + Subject *string `json:"subject,omitempty" tf:"subject,omitempty"` + + // Specifies a dictionary consisting of tag and parameters to replace the tag. + // The value corresponding to the label in the message template. Message publishing using message template mode must + // carry this parameter. The key in the dictionary is the parameter name in the message template, which should not + // exceed 21 characters. The value in the dictionary is the value after replacing the parameters in the message + // template, which does not exceed 1KB. + // Specifies a dictionary consisting of tag and parameters to replace the tag. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // Specifies the maximum retention time of the message within the SMN system. + // After this retention time, the system will no longer send the message. The unit is second, and the default value + // of the variable is 3600 second. The value is a positive integer and less than or equal to 3600*24. + // Specifies the maximum retention time of the message within the SMN system. + TimeToLive *string `json:"timeToLive,omitempty" tf:"time_to_live,omitempty"` + + // Specifies the resource identifier of a topic. + // Specifies the resource identifier of a topic. + TopicUrn *string `json:"topicUrn,omitempty" tf:"topic_urn,omitempty"` +} + +type MessagePublishParameters struct { + + // +kubebuilder:validation:Optional + EnableForceNew *string `json:"enableForceNew,omitempty" tf:"enable_force_new,omitempty"` + + // Specifies the message content. + // Specifies the message content. + // +kubebuilder:validation:Optional + Message *string `json:"message,omitempty" tf:"message,omitempty"` + + // Specifies the message filter policies of a subscriber. + // The message_attributes structure is documented below. + // Specifies the message filter policies of a subscriber. + // +kubebuilder:validation:Optional + MessageAttributes []MessageAttributesParameters `json:"messageAttributes,omitempty" tf:"message_attributes,omitempty"` + + // Specifies the message structure. + // Specifies the message structure. + // +kubebuilder:validation:Optional + MessageStructure *string `json:"messageStructure,omitempty" tf:"message_structure,omitempty"` + + // Specifies the message template name. + // Specifies the message template name. + // +kubebuilder:validation:Optional + MessageTemplateName *string `json:"messageTemplateName,omitempty" tf:"message_template_name,omitempty"` + + // Specifies the region in which to create the resource. + // If omitted, the provider-level region will be used. + // Changing this creates a new resource. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the message title. + // Specifies the message title. + // +kubebuilder:validation:Optional + Subject *string `json:"subject,omitempty" tf:"subject,omitempty"` + + // Specifies a dictionary consisting of tag and parameters to replace the tag. + // The value corresponding to the label in the message template. Message publishing using message template mode must + // carry this parameter. The key in the dictionary is the parameter name in the message template, which should not + // exceed 21 characters. The value in the dictionary is the value after replacing the parameters in the message + // template, which does not exceed 1KB. + // Specifies a dictionary consisting of tag and parameters to replace the tag. + // +kubebuilder:validation:Optional + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // Specifies the maximum retention time of the message within the SMN system. + // After this retention time, the system will no longer send the message. The unit is second, and the default value + // of the variable is 3600 second. The value is a positive integer and less than or equal to 3600*24. + // Specifies the maximum retention time of the message within the SMN system. + // +kubebuilder:validation:Optional + TimeToLive *string `json:"timeToLive,omitempty" tf:"time_to_live,omitempty"` + + // Specifies the resource identifier of a topic. + // Specifies the resource identifier of a topic. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1.Topic + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + TopicUrn *string `json:"topicUrn,omitempty" tf:"topic_urn,omitempty"` + + // Reference to a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnRef *v1.Reference `json:"topicUrnRef,omitempty" tf:"-"` + + // Selector for a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnSelector *v1.Selector `json:"topicUrnSelector,omitempty" tf:"-"` +} + +// MessagePublishSpec defines the desired state of MessagePublish +type MessagePublishSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider MessagePublishParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider MessagePublishInitParameters `json:"initProvider,omitempty"` +} + +// MessagePublishStatus defines the observed state of MessagePublish. +type MessagePublishStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider MessagePublishObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// MessagePublish is the Schema for the MessagePublishs API. Manages a SMN message publishment resource within HuaweiCloud. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,huaweicloud} +type MessagePublish struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec MessagePublishSpec `json:"spec"` + Status MessagePublishStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// MessagePublishList contains a list of MessagePublishs +type MessagePublishList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []MessagePublish `json:"items"` +} + +// Repository type metadata. +var ( + MessagePublish_Kind = "MessagePublish" + MessagePublish_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: MessagePublish_Kind}.String() + MessagePublish_KindAPIVersion = MessagePublish_Kind + "." + CRDGroupVersion.String() + MessagePublish_GroupVersionKind = CRDGroupVersion.WithKind(MessagePublish_Kind) +) + +func init() { + SchemeBuilder.Register(&MessagePublish{}, &MessagePublishList{}) +} diff --git a/apis/smn/v1alpha1/zz_messagetemplate_terraformed.go b/apis/smn/v1alpha1/zz_messagetemplate_terraformed.go new file mode 100755 index 0000000..2b5dce3 --- /dev/null +++ b/apis/smn/v1alpha1/zz_messagetemplate_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this MessageTemplate +func (mg *MessageTemplate) GetTerraformResourceType() string { + return "huaweicloud_smn_message_template" +} + +// GetConnectionDetailsMapping for this MessageTemplate +func (tr *MessageTemplate) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this MessageTemplate +func (tr *MessageTemplate) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this MessageTemplate +func (tr *MessageTemplate) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this MessageTemplate +func (tr *MessageTemplate) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this MessageTemplate +func (tr *MessageTemplate) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this MessageTemplate +func (tr *MessageTemplate) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this MessageTemplate +func (tr *MessageTemplate) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this MessageTemplate +func (tr *MessageTemplate) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this MessageTemplate using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *MessageTemplate) LateInitialize(attrs []byte) (bool, error) { + params := &MessageTemplateParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *MessageTemplate) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/smn/v1alpha1/zz_messagetemplate_types.go b/apis/smn/v1alpha1/zz_messagetemplate_types.go new file mode 100755 index 0000000..8e893a3 --- /dev/null +++ b/apis/smn/v1alpha1/zz_messagetemplate_types.go @@ -0,0 +1,162 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type MessageTemplateInitParameters struct { + + // Specifies the template content, which supports plain text only. + // The template content cannot be left blank or larger than 256 KB. + // The fields within "{}" can be replaced based on the actual situation + // when you use the template. + // Specifies the template content, which supports plain text only. + Content *string `json:"content,omitempty" tf:"content,omitempty"` + + // Specifies the message template name. + // A template name starts with a letter or digit, consists of 1 to 64 characters, + // and can contain only letters, digits, hyphens (-), and underscores (_). + // Specifies the message template name. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Specifies the protocol supported by the template. Value options: + // Specifies the protocol supported by the template. + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // Specifies the region in which to create the resource. + // If omitted, the provider-level region will be used. Changing this parameter will create a new resource. + Region *string `json:"region,omitempty" tf:"region,omitempty"` +} + +type MessageTemplateObservation struct { + + // Specifies the template content, which supports plain text only. + // The template content cannot be left blank or larger than 256 KB. + // The fields within "{}" can be replaced based on the actual situation + // when you use the template. + // Specifies the template content, which supports plain text only. + Content *string `json:"content,omitempty" tf:"content,omitempty"` + + // The resource ID. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Specifies the message template name. + // A template name starts with a letter or digit, consists of 1 to 64 characters, + // and can contain only letters, digits, hyphens (-), and underscores (_). + // Specifies the message template name. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Specifies the protocol supported by the template. Value options: + // Specifies the protocol supported by the template. + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // Specifies the region in which to create the resource. + // If omitted, the provider-level region will be used. Changing this parameter will create a new resource. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Indicates the variable list. The variable name will be quoted in braces ({}) in the template. + // When you use a template to send messages, you can replace the variable with any content. + // Indicates the variable list. + TagNames []*string `json:"tagNames,omitempty" tf:"tag_names,omitempty"` +} + +type MessageTemplateParameters struct { + + // Specifies the template content, which supports plain text only. + // The template content cannot be left blank or larger than 256 KB. + // The fields within "{}" can be replaced based on the actual situation + // when you use the template. + // Specifies the template content, which supports plain text only. + // +kubebuilder:validation:Optional + Content *string `json:"content,omitempty" tf:"content,omitempty"` + + // Specifies the message template name. + // A template name starts with a letter or digit, consists of 1 to 64 characters, + // and can contain only letters, digits, hyphens (-), and underscores (_). + // Specifies the message template name. + // +kubebuilder:validation:Optional + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Specifies the protocol supported by the template. Value options: + // Specifies the protocol supported by the template. + // +kubebuilder:validation:Optional + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // Specifies the region in which to create the resource. + // If omitted, the provider-level region will be used. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` +} + +// MessageTemplateSpec defines the desired state of MessageTemplate +type MessageTemplateSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider MessageTemplateParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider MessageTemplateInitParameters `json:"initProvider,omitempty"` +} + +// MessageTemplateStatus defines the observed state of MessageTemplate. +type MessageTemplateStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider MessageTemplateObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// MessageTemplate is the Schema for the MessageTemplates API. "" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,huaweicloud} +type MessageTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.content) || (has(self.initProvider) && has(self.initProvider.content))",message="spec.forProvider.content is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.name) || (has(self.initProvider) && has(self.initProvider.name))",message="spec.forProvider.name is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.protocol) || (has(self.initProvider) && has(self.initProvider.protocol))",message="spec.forProvider.protocol is a required parameter" + Spec MessageTemplateSpec `json:"spec"` + Status MessageTemplateStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// MessageTemplateList contains a list of MessageTemplates +type MessageTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []MessageTemplate `json:"items"` +} + +// Repository type metadata. +var ( + MessageTemplate_Kind = "MessageTemplate" + MessageTemplate_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: MessageTemplate_Kind}.String() + MessageTemplate_KindAPIVersion = MessageTemplate_Kind + "." + CRDGroupVersion.String() + MessageTemplate_GroupVersionKind = CRDGroupVersion.WithKind(MessageTemplate_Kind) +) + +func init() { + SchemeBuilder.Register(&MessageTemplate{}, &MessageTemplateList{}) +} diff --git a/apis/smn/v1alpha1/zz_subscription_terraformed.go b/apis/smn/v1alpha1/zz_subscription_terraformed.go new file mode 100755 index 0000000..7471f7d --- /dev/null +++ b/apis/smn/v1alpha1/zz_subscription_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this Subscription +func (mg *Subscription) GetTerraformResourceType() string { + return "huaweicloud_smn_subscription" +} + +// GetConnectionDetailsMapping for this Subscription +func (tr *Subscription) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Subscription +func (tr *Subscription) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this Subscription +func (tr *Subscription) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this Subscription +func (tr *Subscription) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Subscription +func (tr *Subscription) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this Subscription +func (tr *Subscription) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this Subscription +func (tr *Subscription) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this Subscription +func (tr *Subscription) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this Subscription using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Subscription) LateInitialize(attrs []byte) (bool, error) { + params := &SubscriptionParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *Subscription) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/smn/v1alpha1/zz_subscription_types.go b/apis/smn/v1alpha1/zz_subscription_types.go new file mode 100755 index 0000000..2a334a2 --- /dev/null +++ b/apis/smn/v1alpha1/zz_subscription_types.go @@ -0,0 +1,301 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type ExtensionInitParameters struct { + + // Specifies the client ID. This field is the tenant ID field in + // the WeLink subscription and is obtained by the tenant from WeLink. This field is mandatory when protocol + // is set to welink. Changing this parameter will create a new resource. + ClientID *string `json:"clientId,omitempty" tf:"client_id,omitempty"` + + // Specifies the client secret. This field is the client secret + // field obtained by the tenant from WeLink. This field is mandatory when protocol is set to welink. + // Changing this parameter will create a new resource. + ClientSecret *string `json:"clientSecret,omitempty" tf:"client_secret,omitempty"` + + // Specifies the keyword. When protocol is set to feishu, + // either keyword or sign_secret must be specified. When you use keywords to configure a security policy + // for the Lark or DingTalk chatbot on SMN, the keywords must have one of the keywords configured on the Lark + // or DingTalk client. Changing this parameter will create a new resource. + Keyword *string `json:"keyword,omitempty" tf:"keyword,omitempty"` + + // Specifies the key including signature. When protocol is set + // to feishu or dingding, this field or keyword must be specified. The key configurations must be + // the same as those on the Lark or DingTalk client. For example, if only key is configured on the Lark client, + // enter the key field obtained from the Lark client. If only keyword is configured on the Lark client, skip this field. + // Changing this parameter will create a new resource. + SignSecret *string `json:"signSecret,omitempty" tf:"sign_secret,omitempty"` +} + +type ExtensionObservation struct { + + // Specifies the client ID. This field is the tenant ID field in + // the WeLink subscription and is obtained by the tenant from WeLink. This field is mandatory when protocol + // is set to welink. Changing this parameter will create a new resource. + ClientID *string `json:"clientId,omitempty" tf:"client_id,omitempty"` + + // Specifies the client secret. This field is the client secret + // field obtained by the tenant from WeLink. This field is mandatory when protocol is set to welink. + // Changing this parameter will create a new resource. + ClientSecret *string `json:"clientSecret,omitempty" tf:"client_secret,omitempty"` + + // Specifies the keyword. When protocol is set to feishu, + // either keyword or sign_secret must be specified. When you use keywords to configure a security policy + // for the Lark or DingTalk chatbot on SMN, the keywords must have one of the keywords configured on the Lark + // or DingTalk client. Changing this parameter will create a new resource. + Keyword *string `json:"keyword,omitempty" tf:"keyword,omitempty"` + + // Specifies the key including signature. When protocol is set + // to feishu or dingding, this field or keyword must be specified. The key configurations must be + // the same as those on the Lark or DingTalk client. For example, if only key is configured on the Lark client, + // enter the key field obtained from the Lark client. If only keyword is configured on the Lark client, skip this field. + // Changing this parameter will create a new resource. + SignSecret *string `json:"signSecret,omitempty" tf:"sign_secret,omitempty"` +} + +type ExtensionParameters struct { + + // Specifies the client ID. This field is the tenant ID field in + // the WeLink subscription and is obtained by the tenant from WeLink. This field is mandatory when protocol + // is set to welink. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + ClientID *string `json:"clientId,omitempty" tf:"client_id,omitempty"` + + // Specifies the client secret. This field is the client secret + // field obtained by the tenant from WeLink. This field is mandatory when protocol is set to welink. + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + ClientSecret *string `json:"clientSecret,omitempty" tf:"client_secret,omitempty"` + + // Specifies the keyword. When protocol is set to feishu, + // either keyword or sign_secret must be specified. When you use keywords to configure a security policy + // for the Lark or DingTalk chatbot on SMN, the keywords must have one of the keywords configured on the Lark + // or DingTalk client. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + Keyword *string `json:"keyword,omitempty" tf:"keyword,omitempty"` + + // Specifies the key including signature. When protocol is set + // to feishu or dingding, this field or keyword must be specified. The key configurations must be + // the same as those on the Lark or DingTalk client. For example, if only key is configured on the Lark client, + // enter the key field obtained from the Lark client. If only keyword is configured on the Lark client, skip this field. + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + SignSecret *string `json:"signSecret,omitempty" tf:"sign_secret,omitempty"` +} + +type FilterPoliciesInitParameters struct { +} + +type FilterPoliciesObservation struct { + + // The filter policy name. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // The string array for exact match. + StringEquals []*string `json:"stringEquals,omitempty" tf:"string_equals,omitempty"` +} + +type FilterPoliciesParameters struct { +} + +type SubscriptionInitParameters struct { + + // Message endpoint. Changing this parameter will create a new resource. + Endpoint *string `json:"endpoint,omitempty" tf:"endpoint,omitempty"` + + // Specifies the extension configurations. + // The extension structure is documented below. + // Changing this parameter will create a new resource. + Extension []ExtensionInitParameters `json:"extension,omitempty" tf:"extension,omitempty"` + + // Specifies the protocol of the message endpoint. Currently, email, + // sms, http, https, functionstage, functiongraph, callnotify, wechat, dingding, + // feishu and welink are supported. Changing this parameter will create a new resource. + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // The region in which to create the SMN subscription resource. If omitted, the + // provider-level region will be used. Changing this parameter will create a new resource. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Remark information. The remarks must be a UTF-8-coded character string + // containing 128 bytes. Changing this parameter will create a new resource. + Remark *string `json:"remark,omitempty" tf:"remark,omitempty"` + + // Specifies the resource identifier of a topic, which is unique. + // Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1.Topic + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + TopicUrn *string `json:"topicUrn,omitempty" tf:"topic_urn,omitempty"` + + // Reference to a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnRef *v1.Reference `json:"topicUrnRef,omitempty" tf:"-"` + + // Selector for a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnSelector *v1.Selector `json:"topicUrnSelector,omitempty" tf:"-"` +} + +type SubscriptionObservation struct { + + // Message endpoint. Changing this parameter will create a new resource. + Endpoint *string `json:"endpoint,omitempty" tf:"endpoint,omitempty"` + + // Specifies the extension configurations. + // The extension structure is documented below. + // Changing this parameter will create a new resource. + Extension []ExtensionObservation `json:"extension,omitempty" tf:"extension,omitempty"` + + // The message filter policies of a subscriber. + // The filter_policies structure is documented below. + // The message filter policies of a subscriber. + FilterPolicies []FilterPoliciesObservation `json:"filterPolicies,omitempty" tf:"filter_policies,omitempty"` + + // The resource ID. The value is the subscription urn. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Project ID of the topic creator. + Owner *string `json:"owner,omitempty" tf:"owner,omitempty"` + + // Specifies the protocol of the message endpoint. Currently, email, + // sms, http, https, functionstage, functiongraph, callnotify, wechat, dingding, + // feishu and welink are supported. Changing this parameter will create a new resource. + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // The region in which to create the SMN subscription resource. If omitted, the + // provider-level region will be used. Changing this parameter will create a new resource. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Remark information. The remarks must be a UTF-8-coded character string + // containing 128 bytes. Changing this parameter will create a new resource. + Remark *string `json:"remark,omitempty" tf:"remark,omitempty"` + + // Subscription status. + Status *float64 `json:"status,omitempty" tf:"status,omitempty"` + + // Resource identifier of a subscription, which is unique. + SubscriptionUrn *string `json:"subscriptionUrn,omitempty" tf:"subscription_urn,omitempty"` + + // Specifies the resource identifier of a topic, which is unique. + // Changing this parameter will create a new resource. + TopicUrn *string `json:"topicUrn,omitempty" tf:"topic_urn,omitempty"` +} + +type SubscriptionParameters struct { + + // Message endpoint. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + Endpoint *string `json:"endpoint,omitempty" tf:"endpoint,omitempty"` + + // Specifies the extension configurations. + // The extension structure is documented below. + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + Extension []ExtensionParameters `json:"extension,omitempty" tf:"extension,omitempty"` + + // Specifies the protocol of the message endpoint. Currently, email, + // sms, http, https, functionstage, functiongraph, callnotify, wechat, dingding, + // feishu and welink are supported. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // The region in which to create the SMN subscription resource. If omitted, the + // provider-level region will be used. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Remark information. The remarks must be a UTF-8-coded character string + // containing 128 bytes. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + Remark *string `json:"remark,omitempty" tf:"remark,omitempty"` + + // Specifies the resource identifier of a topic, which is unique. + // Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1.Topic + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + TopicUrn *string `json:"topicUrn,omitempty" tf:"topic_urn,omitempty"` + + // Reference to a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnRef *v1.Reference `json:"topicUrnRef,omitempty" tf:"-"` + + // Selector for a Topic in smn to populate topicUrn. + // +kubebuilder:validation:Optional + TopicUrnSelector *v1.Selector `json:"topicUrnSelector,omitempty" tf:"-"` +} + +// SubscriptionSpec defines the desired state of Subscription +type SubscriptionSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider SubscriptionParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider SubscriptionInitParameters `json:"initProvider,omitempty"` +} + +// SubscriptionStatus defines the observed state of Subscription. +type SubscriptionStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider SubscriptionObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// Subscription is the Schema for the Subscriptions API. "" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,huaweicloud} +type Subscription struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.endpoint) || (has(self.initProvider) && has(self.initProvider.endpoint))",message="spec.forProvider.endpoint is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.protocol) || (has(self.initProvider) && has(self.initProvider.protocol))",message="spec.forProvider.protocol is a required parameter" + Spec SubscriptionSpec `json:"spec"` + Status SubscriptionStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// SubscriptionList contains a list of Subscriptions +type SubscriptionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Subscription `json:"items"` +} + +// Repository type metadata. +var ( + Subscription_Kind = "Subscription" + Subscription_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Subscription_Kind}.String() + Subscription_KindAPIVersion = Subscription_Kind + "." + CRDGroupVersion.String() + Subscription_GroupVersionKind = CRDGroupVersion.WithKind(Subscription_Kind) +) + +func init() { + SchemeBuilder.Register(&Subscription{}, &SubscriptionList{}) +} diff --git a/apis/smn/v1alpha1/zz_subscriptionfilterpolicy_terraformed.go b/apis/smn/v1alpha1/zz_subscriptionfilterpolicy_terraformed.go new file mode 100755 index 0000000..0770e71 --- /dev/null +++ b/apis/smn/v1alpha1/zz_subscriptionfilterpolicy_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this SubscriptionFilterPolicy +func (mg *SubscriptionFilterPolicy) GetTerraformResourceType() string { + return "huaweicloud_smn_subscription_filter_policy" +} + +// GetConnectionDetailsMapping for this SubscriptionFilterPolicy +func (tr *SubscriptionFilterPolicy) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this SubscriptionFilterPolicy +func (tr *SubscriptionFilterPolicy) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this SubscriptionFilterPolicy +func (tr *SubscriptionFilterPolicy) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this SubscriptionFilterPolicy +func (tr *SubscriptionFilterPolicy) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this SubscriptionFilterPolicy +func (tr *SubscriptionFilterPolicy) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this SubscriptionFilterPolicy +func (tr *SubscriptionFilterPolicy) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this SubscriptionFilterPolicy +func (tr *SubscriptionFilterPolicy) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this SubscriptionFilterPolicy +func (tr *SubscriptionFilterPolicy) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this SubscriptionFilterPolicy using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *SubscriptionFilterPolicy) LateInitialize(attrs []byte) (bool, error) { + params := &SubscriptionFilterPolicyParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *SubscriptionFilterPolicy) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/smn/v1alpha1/zz_subscriptionfilterpolicy_types.go b/apis/smn/v1alpha1/zz_subscriptionfilterpolicy_types.go new file mode 100755 index 0000000..682ce06 --- /dev/null +++ b/apis/smn/v1alpha1/zz_subscriptionfilterpolicy_types.go @@ -0,0 +1,202 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type SubscriptionFilterPolicyFilterPoliciesInitParameters struct { + + // Specifies the filter policy name. The policy name must be unique. + // Specifies the filter policy name. The policy name must be unique. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Specifies the string array for exact match. The array can contain 1 + // to 10 strings. The array content must be unique. The string cannot be null or an empty string "". + // A string can contain 1 to 32 characters, including letters, digits, and underscores (_). + // Specifies the string array for exact match. + // +listType=set + StringEquals []*string `json:"stringEquals,omitempty" tf:"string_equals,omitempty"` +} + +type SubscriptionFilterPolicyFilterPoliciesObservation struct { + + // Specifies the filter policy name. The policy name must be unique. + // Specifies the filter policy name. The policy name must be unique. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Specifies the string array for exact match. The array can contain 1 + // to 10 strings. The array content must be unique. The string cannot be null or an empty string "". + // A string can contain 1 to 32 characters, including letters, digits, and underscores (_). + // Specifies the string array for exact match. + // +listType=set + StringEquals []*string `json:"stringEquals,omitempty" tf:"string_equals,omitempty"` +} + +type SubscriptionFilterPolicyFilterPoliciesParameters struct { + + // Specifies the filter policy name. The policy name must be unique. + // Specifies the filter policy name. The policy name must be unique. + // +kubebuilder:validation:Optional + Name *string `json:"name" tf:"name,omitempty"` + + // Specifies the string array for exact match. The array can contain 1 + // to 10 strings. The array content must be unique. The string cannot be null or an empty string "". + // A string can contain 1 to 32 characters, including letters, digits, and underscores (_). + // Specifies the string array for exact match. + // +kubebuilder:validation:Optional + // +listType=set + StringEquals []*string `json:"stringEquals" tf:"string_equals,omitempty"` +} + +type SubscriptionFilterPolicyInitParameters struct { + EnableForceNew *string `json:"enableForceNew,omitempty" tf:"enable_force_new,omitempty"` + + // Specifies the message filter policies of a subscriber. + // The filter_policies structure is documented below. + // Specifies the message filter policies of a subscriber. + FilterPolicies []SubscriptionFilterPolicyFilterPoliciesInitParameters `json:"filterPolicies,omitempty" tf:"filter_policies,omitempty"` + + // Specifies the region in which to create the resource. + // If omitted, the provider-level region will be used. + // Changing this creates a new resource. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the resource identifier of the subscriber. + // Specifies the resource identifier of the subscriber. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1.Subscription + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + SubscriptionUrn *string `json:"subscriptionUrn,omitempty" tf:"subscription_urn,omitempty"` + + // Reference to a Subscription in smn to populate subscriptionUrn. + // +kubebuilder:validation:Optional + SubscriptionUrnRef *v1.Reference `json:"subscriptionUrnRef,omitempty" tf:"-"` + + // Selector for a Subscription in smn to populate subscriptionUrn. + // +kubebuilder:validation:Optional + SubscriptionUrnSelector *v1.Selector `json:"subscriptionUrnSelector,omitempty" tf:"-"` +} + +type SubscriptionFilterPolicyObservation struct { + EnableForceNew *string `json:"enableForceNew,omitempty" tf:"enable_force_new,omitempty"` + + // Specifies the message filter policies of a subscriber. + // The filter_policies structure is documented below. + // Specifies the message filter policies of a subscriber. + FilterPolicies []SubscriptionFilterPolicyFilterPoliciesObservation `json:"filterPolicies,omitempty" tf:"filter_policies,omitempty"` + + // The resource ID. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Specifies the region in which to create the resource. + // If omitted, the provider-level region will be used. + // Changing this creates a new resource. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the resource identifier of the subscriber. + // Specifies the resource identifier of the subscriber. + SubscriptionUrn *string `json:"subscriptionUrn,omitempty" tf:"subscription_urn,omitempty"` +} + +type SubscriptionFilterPolicyParameters struct { + + // +kubebuilder:validation:Optional + EnableForceNew *string `json:"enableForceNew,omitempty" tf:"enable_force_new,omitempty"` + + // Specifies the message filter policies of a subscriber. + // The filter_policies structure is documented below. + // Specifies the message filter policies of a subscriber. + // +kubebuilder:validation:Optional + FilterPolicies []SubscriptionFilterPolicyFilterPoliciesParameters `json:"filterPolicies,omitempty" tf:"filter_policies,omitempty"` + + // Specifies the region in which to create the resource. + // If omitted, the provider-level region will be used. + // Changing this creates a new resource. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the resource identifier of the subscriber. + // Specifies the resource identifier of the subscriber. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1.Subscription + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + SubscriptionUrn *string `json:"subscriptionUrn,omitempty" tf:"subscription_urn,omitempty"` + + // Reference to a Subscription in smn to populate subscriptionUrn. + // +kubebuilder:validation:Optional + SubscriptionUrnRef *v1.Reference `json:"subscriptionUrnRef,omitempty" tf:"-"` + + // Selector for a Subscription in smn to populate subscriptionUrn. + // +kubebuilder:validation:Optional + SubscriptionUrnSelector *v1.Selector `json:"subscriptionUrnSelector,omitempty" tf:"-"` +} + +// SubscriptionFilterPolicySpec defines the desired state of SubscriptionFilterPolicy +type SubscriptionFilterPolicySpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider SubscriptionFilterPolicyParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider SubscriptionFilterPolicyInitParameters `json:"initProvider,omitempty"` +} + +// SubscriptionFilterPolicyStatus defines the observed state of SubscriptionFilterPolicy. +type SubscriptionFilterPolicyStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider SubscriptionFilterPolicyObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// SubscriptionFilterPolicy is the Schema for the SubscriptionFilterPolicys API. Manages an SMN subscription filter policy resource within HuaweiCloud. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,huaweicloud} +type SubscriptionFilterPolicy struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.filterPolicies) || (has(self.initProvider) && has(self.initProvider.filterPolicies))",message="spec.forProvider.filterPolicies is a required parameter" + Spec SubscriptionFilterPolicySpec `json:"spec"` + Status SubscriptionFilterPolicyStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// SubscriptionFilterPolicyList contains a list of SubscriptionFilterPolicys +type SubscriptionFilterPolicyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []SubscriptionFilterPolicy `json:"items"` +} + +// Repository type metadata. +var ( + SubscriptionFilterPolicy_Kind = "SubscriptionFilterPolicy" + SubscriptionFilterPolicy_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: SubscriptionFilterPolicy_Kind}.String() + SubscriptionFilterPolicy_KindAPIVersion = SubscriptionFilterPolicy_Kind + "." + CRDGroupVersion.String() + SubscriptionFilterPolicy_GroupVersionKind = CRDGroupVersion.WithKind(SubscriptionFilterPolicy_Kind) +) + +func init() { + SchemeBuilder.Register(&SubscriptionFilterPolicy{}, &SubscriptionFilterPolicyList{}) +} diff --git a/apis/smn/v1alpha1/zz_topic_terraformed.go b/apis/smn/v1alpha1/zz_topic_terraformed.go new file mode 100755 index 0000000..4286a44 --- /dev/null +++ b/apis/smn/v1alpha1/zz_topic_terraformed.go @@ -0,0 +1,136 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this Topic +func (mg *Topic) GetTerraformResourceType() string { + return "huaweicloud_smn_topic" +} + +// GetConnectionDetailsMapping for this Topic +func (tr *Topic) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Topic +func (tr *Topic) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this Topic +func (tr *Topic) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this Topic +func (tr *Topic) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Topic +func (tr *Topic) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this Topic +func (tr *Topic) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this Topic +func (tr *Topic) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this Topic +func (tr *Topic) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this Topic using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Topic) LateInitialize(attrs []byte) (bool, error) { + params := &TopicParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + initParams, err := tr.GetInitParameters() + if err != nil { + return false, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + opts = append(opts, resource.WithConditionalFilter("AccessPolicy", initParams)) + opts = append(opts, resource.WithConditionalFilter("ServicesPublishAllowed", initParams)) + opts = append(opts, resource.WithConditionalFilter("UsersPublishAllowed", initParams)) + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *Topic) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/smn/v1alpha1/zz_topic_types.go b/apis/smn/v1alpha1/zz_topic_types.go new file mode 100755 index 0000000..04fbb8b --- /dev/null +++ b/apis/smn/v1alpha1/zz_topic_types.go @@ -0,0 +1,223 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type TopicInitParameters struct { + + // schema: Internal + AccessPolicy *string `json:"accessPolicy,omitempty" tf:"access_policy,omitempty"` + + // Specifies the topic display name, which is presented as the name of the email + // sender in an email message. The name can contains of 0 to 192 characters. + DisplayName *string `json:"displayName,omitempty" tf:"display_name,omitempty"` + + // Specifies the enterprise project id of the SMN Topic, Value 0 + // indicates the default enterprise project. Changing this parameter will create a new resource. + EnterpriseProjectID *string `json:"enterpriseProjectId,omitempty" tf:"enterprise_project_id,omitempty"` + + // Specifies the introduction of the topic, + // this will be contained in the subscription invitation. + Introduction *string `json:"introduction,omitempty" tf:"introduction,omitempty"` + + // Specifies the name of the topic to be created. The name can contains of 1 to 255 + // characters and must start with a letter or digit, and can only contain letters, digits, underscores (_), and hyphens (-). + // Changing this parameter will create a new resource. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // The region in which to create the SMN topic resource. If omitted, the + // provider-level region will be used. Changing this parameter will create a new resource. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the services that can publish messages to this topic + // separated by comma(,). If left empty, that means no service allowed. + ServicesPublishAllowed *string `json:"servicesPublishAllowed,omitempty" tf:"services_publish_allowed,omitempty"` + + // Specifies the tags of the SMN topic, key/value pair format. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // Specifies the users who can publish messages to this topic. + // The value can be * which indicates all users or user account URNs separated by comma(,). The format of + // user account URN is urn:csp:iam::domainId:root. domainId indicates the account ID of another user. + // If left empty, that means only the topic creator can publish messages. + UsersPublishAllowed *string `json:"usersPublishAllowed,omitempty" tf:"users_publish_allowed,omitempty"` +} + +type TopicObservation struct { + + // schema: Internal + AccessPolicy *string `json:"accessPolicy,omitempty" tf:"access_policy,omitempty"` + + // Time when the topic was created. + CreateTime *string `json:"createTime,omitempty" tf:"create_time,omitempty"` + + // Specifies the topic display name, which is presented as the name of the email + // sender in an email message. The name can contains of 0 to 192 characters. + DisplayName *string `json:"displayName,omitempty" tf:"display_name,omitempty"` + + // Specifies the enterprise project id of the SMN Topic, Value 0 + // indicates the default enterprise project. Changing this parameter will create a new resource. + EnterpriseProjectID *string `json:"enterpriseProjectId,omitempty" tf:"enterprise_project_id,omitempty"` + + // The resource ID. The value is the topic urn. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Specifies the introduction of the topic, + // this will be contained in the subscription invitation. + Introduction *string `json:"introduction,omitempty" tf:"introduction,omitempty"` + + // Specifies the name of the topic to be created. The name can contains of 1 to 255 + // characters and must start with a letter or digit, and can only contain letters, digits, underscores (_), and hyphens (-). + // Changing this parameter will create a new resource. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Message pushing policy. + PushPolicy *float64 `json:"pushPolicy,omitempty" tf:"push_policy,omitempty"` + + // The region in which to create the SMN topic resource. If omitted, the + // provider-level region will be used. Changing this parameter will create a new resource. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the services that can publish messages to this topic + // separated by comma(,). If left empty, that means no service allowed. + ServicesPublishAllowed *string `json:"servicesPublishAllowed,omitempty" tf:"services_publish_allowed,omitempty"` + + // Specifies the tags of the SMN topic, key/value pair format. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // Resource identifier of a topic, which is unique. + TopicUrn *string `json:"topicUrn,omitempty" tf:"topic_urn,omitempty"` + + // Time when the topic was updated. + UpdateTime *string `json:"updateTime,omitempty" tf:"update_time,omitempty"` + + // Specifies the users who can publish messages to this topic. + // The value can be * which indicates all users or user account URNs separated by comma(,). The format of + // user account URN is urn:csp:iam::domainId:root. domainId indicates the account ID of another user. + // If left empty, that means only the topic creator can publish messages. + UsersPublishAllowed *string `json:"usersPublishAllowed,omitempty" tf:"users_publish_allowed,omitempty"` +} + +type TopicParameters struct { + + // schema: Internal + // +kubebuilder:validation:Optional + AccessPolicy *string `json:"accessPolicy,omitempty" tf:"access_policy,omitempty"` + + // Specifies the topic display name, which is presented as the name of the email + // sender in an email message. The name can contains of 0 to 192 characters. + // +kubebuilder:validation:Optional + DisplayName *string `json:"displayName,omitempty" tf:"display_name,omitempty"` + + // Specifies the enterprise project id of the SMN Topic, Value 0 + // indicates the default enterprise project. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + EnterpriseProjectID *string `json:"enterpriseProjectId,omitempty" tf:"enterprise_project_id,omitempty"` + + // Specifies the introduction of the topic, + // this will be contained in the subscription invitation. + // +kubebuilder:validation:Optional + Introduction *string `json:"introduction,omitempty" tf:"introduction,omitempty"` + + // Specifies the name of the topic to be created. The name can contains of 1 to 255 + // characters and must start with a letter or digit, and can only contain letters, digits, underscores (_), and hyphens (-). + // Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // The region in which to create the SMN topic resource. If omitted, the + // provider-level region will be used. Changing this parameter will create a new resource. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the services that can publish messages to this topic + // separated by comma(,). If left empty, that means no service allowed. + // +kubebuilder:validation:Optional + ServicesPublishAllowed *string `json:"servicesPublishAllowed,omitempty" tf:"services_publish_allowed,omitempty"` + + // Specifies the tags of the SMN topic, key/value pair format. + // +kubebuilder:validation:Optional + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // Specifies the users who can publish messages to this topic. + // The value can be * which indicates all users or user account URNs separated by comma(,). The format of + // user account URN is urn:csp:iam::domainId:root. domainId indicates the account ID of another user. + // If left empty, that means only the topic creator can publish messages. + // +kubebuilder:validation:Optional + UsersPublishAllowed *string `json:"usersPublishAllowed,omitempty" tf:"users_publish_allowed,omitempty"` +} + +// TopicSpec defines the desired state of Topic +type TopicSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider TopicParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider TopicInitParameters `json:"initProvider,omitempty"` +} + +// TopicStatus defines the observed state of Topic. +type TopicStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider TopicObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// Topic is the Schema for the Topics API. "" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,huaweicloud} +type Topic struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.name) || (has(self.initProvider) && has(self.initProvider.name))",message="spec.forProvider.name is a required parameter" + Spec TopicSpec `json:"spec"` + Status TopicStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// TopicList contains a list of Topics +type TopicList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Topic `json:"items"` +} + +// Repository type metadata. +var ( + Topic_Kind = "Topic" + Topic_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Topic_Kind}.String() + Topic_KindAPIVersion = Topic_Kind + "." + CRDGroupVersion.String() + Topic_GroupVersionKind = CRDGroupVersion.WithKind(Topic_Kind) +) + +func init() { + SchemeBuilder.Register(&Topic{}, &TopicList{}) +} diff --git a/apis/zz_register.go b/apis/zz_register.go index 67e1b9b..95612f0 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -21,6 +21,7 @@ import ( v1alpha1nat "github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1" v1alpha1obs "github.com/huaweicloud/provider-huaweicloud/apis/obs/v1alpha1" v1alpha1rds "github.com/huaweicloud/provider-huaweicloud/apis/rds/v1alpha1" + v1alpha1smn "github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1" v1alpha1swr "github.com/huaweicloud/provider-huaweicloud/apis/swr/v1alpha1" v1alpha1apis "github.com/huaweicloud/provider-huaweicloud/apis/v1alpha1" v1beta1 "github.com/huaweicloud/provider-huaweicloud/apis/v1beta1" @@ -41,6 +42,7 @@ func init() { v1alpha1nat.SchemeBuilder.AddToScheme, v1alpha1obs.SchemeBuilder.AddToScheme, v1alpha1rds.SchemeBuilder.AddToScheme, + v1alpha1smn.SchemeBuilder.AddToScheme, v1alpha1swr.SchemeBuilder.AddToScheme, v1alpha1apis.SchemeBuilder.AddToScheme, v1beta1.SchemeBuilder.AddToScheme, diff --git a/config/external_name.go b/config/external_name.go index fa0854e..b1e6336 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -155,6 +155,14 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "huaweicloud_rds_sqlserver_database": config.IdentifierFromProvider, "huaweicloud_rds_sqlserver_database_privilege": config.IdentifierFromProvider, + "huaweicloud_smn_logtank": config.IdentifierFromProvider, + "huaweicloud_smn_message_detection": config.IdentifierFromProvider, + "huaweicloud_smn_message_publish": config.IdentifierFromProvider, + "huaweicloud_smn_message_template": config.IdentifierFromProvider, + "huaweicloud_smn_subscription": config.IdentifierFromProvider, + "huaweicloud_smn_subscription_filter_policy": config.IdentifierFromProvider, + "huaweicloud_smn_topic": config.IdentifierFromProvider, + // swr "huaweicloud_swr_image_auto_sync": config.IdentifierFromProvider, "huaweicloud_swr_image_permissions": config.IdentifierFromProvider, diff --git a/config/provider.go b/config/provider.go index 2099ea5..3b2ef6f 100644 --- a/config/provider.go +++ b/config/provider.go @@ -19,6 +19,7 @@ import ( "github.com/huaweicloud/provider-huaweicloud/config/nat" "github.com/huaweicloud/provider-huaweicloud/config/obs" "github.com/huaweicloud/provider-huaweicloud/config/rds" + "github.com/huaweicloud/provider-huaweicloud/config/smn" "github.com/huaweicloud/provider-huaweicloud/config/swr" ujconfig "github.com/crossplane/upjet/pkg/config" @@ -62,6 +63,7 @@ func GetProvider() *ujconfig.Provider { swr.Configure, evs.Configure, nat.Configure, + smn.Configure, } { configure(pc) } diff --git a/config/smn/config.go b/config/smn/config.go new file mode 100644 index 0000000..4818597 --- /dev/null +++ b/config/smn/config.go @@ -0,0 +1,71 @@ +package smn + +import ( + "github.com/crossplane/upjet/pkg/config" +) + +const shortGroupSmn = "smn" + +// Configure configures individual resources by adding custom ResourceConfigurators. +func Configure(p *config.Provider) { + p.AddResourceConfigurator("huaweicloud_smn_logtank", func(r *config.Resource) { + r.ShortGroup = shortGroupSmn + + r.References["topic_urn"] = config.Reference{ + TerraformName: "huaweicloud_smn_topic", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + }) + + p.AddResourceConfigurator("huaweicloud_smn_message_detection", func(r *config.Resource) { + r.ShortGroup = shortGroupSmn + + r.References["topic_urn"] = config.Reference{ + TerraformName: "huaweicloud_smn_topic", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + }) + + p.AddResourceConfigurator("huaweicloud_smn_message_publish", func(r *config.Resource) { + r.ShortGroup = shortGroupSmn + + r.References["topic_urn"] = config.Reference{ + TerraformName: "huaweicloud_smn_topic", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + + r.LateInitializer = config.LateInitializer{ + ConditionalIgnoredFields: []string{"message", "message_structure", "message_template_name"}, + } + }) + + p.AddResourceConfigurator("huaweicloud_smn_message_template", func(r *config.Resource) { + r.ShortGroup = shortGroupSmn + }) + + p.AddResourceConfigurator("huaweicloud_smn_subscription", func(r *config.Resource) { + r.ShortGroup = shortGroupSmn + + r.References["topic_urn"] = config.Reference{ + TerraformName: "huaweicloud_smn_topic", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + }) + + p.AddResourceConfigurator("huaweicloud_smn_subscription_filter_policy", func(r *config.Resource) { + r.ShortGroup = shortGroupSmn + + r.References["subscription_urn"] = config.Reference{ + TerraformName: "huaweicloud_smn_subscription", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + }) + + p.AddResourceConfigurator("huaweicloud_smn_topic", func(r *config.Resource) { + r.ShortGroup = shortGroupSmn + + r.LateInitializer = config.LateInitializer{ + ConditionalIgnoredFields: []string{"users_publish_allowed", "services_publish_allowed", "access_policy"}, + } + }) +} diff --git a/examples-generated/smn/v1alpha1/logtank.yaml b/examples-generated/smn/v1alpha1/logtank.yaml new file mode 100644 index 0000000..41809bb --- /dev/null +++ b/examples-generated/smn/v1alpha1/logtank.yaml @@ -0,0 +1,29 @@ +apiVersion: smn.huaweicloud.crossplane.io/v1alpha1 +kind: Logtank +metadata: + annotations: + meta.upbound.io/example-id: smn/v1alpha1/logtank + labels: + testing.upbound.io/example-name: logtank_test + name: logtank-test +spec: + forProvider: + logGroupId: ${huaweicloud_lts_group.lts_group_test.id} + logStreamId: ${huaweicloud_lts_stream.lts_stream_test.id} + topicUrnSelector: + matchLabels: + testing.upbound.io/example-name: topic_test + +--- + +apiVersion: smn.huaweicloud.crossplane.io/v1alpha1 +kind: Topic +metadata: + annotations: + meta.upbound.io/example-id: smn/v1alpha1/logtank + labels: + testing.upbound.io/example-name: topic_test + name: topic-test +spec: + forProvider: + name: topic_test diff --git a/examples-generated/smn/v1alpha1/messagedetection.yaml b/examples-generated/smn/v1alpha1/messagedetection.yaml new file mode 100644 index 0000000..ddd43f0 --- /dev/null +++ b/examples-generated/smn/v1alpha1/messagedetection.yaml @@ -0,0 +1,15 @@ +apiVersion: smn.huaweicloud.crossplane.io/v1alpha1 +kind: MessageDetection +metadata: + annotations: + meta.upbound.io/example-id: smn/v1alpha1/messagedetection + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: + endpoint: https://example.com/notification/action + protocol: https + topicUrnSelector: + matchLabels: + testing.upbound.io/example-name: example diff --git a/examples-generated/smn/v1alpha1/messagepublish.yaml b/examples-generated/smn/v1alpha1/messagepublish.yaml new file mode 100644 index 0000000..7188adf --- /dev/null +++ b/examples-generated/smn/v1alpha1/messagepublish.yaml @@ -0,0 +1,15 @@ +apiVersion: smn.huaweicloud.crossplane.io/v1alpha1 +kind: MessagePublish +metadata: + annotations: + meta.upbound.io/example-id: smn/v1alpha1/messagepublish + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: + message: test + subject: ${var.subject} + topicUrnSelector: + matchLabels: + testing.upbound.io/example-name: example diff --git a/examples-generated/smn/v1alpha1/messagetemplate.yaml b/examples-generated/smn/v1alpha1/messagetemplate.yaml new file mode 100644 index 0000000..78999f0 --- /dev/null +++ b/examples-generated/smn/v1alpha1/messagetemplate.yaml @@ -0,0 +1,13 @@ +apiVersion: smn.huaweicloud.crossplane.io/v1alpha1 +kind: MessageTemplate +metadata: + annotations: + meta.upbound.io/example-id: smn/v1alpha1/messagetemplate + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: + content: this content contains {content1}, {content2}, {content3} + name: ${var.name} + protocol: ${var.protocol} diff --git a/examples-generated/smn/v1alpha1/subscription.yaml b/examples-generated/smn/v1alpha1/subscription.yaml new file mode 100644 index 0000000..bbdee2f --- /dev/null +++ b/examples-generated/smn/v1alpha1/subscription.yaml @@ -0,0 +1,31 @@ +apiVersion: smn.huaweicloud.crossplane.io/v1alpha1 +kind: Subscription +metadata: + annotations: + meta.upbound.io/example-id: smn/v1alpha1/subscription + labels: + testing.upbound.io/example-name: subscription_1 + name: subscription-1 +spec: + forProvider: + endpoint: mailtest@gmail.com + protocol: email + remark: O&M + topicUrnSelector: + matchLabels: + testing.upbound.io/example-name: topic_1 + +--- + +apiVersion: smn.huaweicloud.crossplane.io/v1alpha1 +kind: Topic +metadata: + annotations: + meta.upbound.io/example-id: smn/v1alpha1/subscription + labels: + testing.upbound.io/example-name: topic_1 + name: topic-1 +spec: + forProvider: + displayName: The display name of topic_1 + name: topic_1 diff --git a/examples-generated/smn/v1alpha1/subscriptionfilterpolicy.yaml b/examples-generated/smn/v1alpha1/subscriptionfilterpolicy.yaml new file mode 100644 index 0000000..cb95d29 --- /dev/null +++ b/examples-generated/smn/v1alpha1/subscriptionfilterpolicy.yaml @@ -0,0 +1,18 @@ +apiVersion: smn.huaweicloud.crossplane.io/v1alpha1 +kind: SubscriptionFilterPolicy +metadata: + annotations: + meta.upbound.io/example-id: smn/v1alpha1/subscriptionfilterpolicy + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: + filterPolicies: + - name: alarm + stringEquals: + - os + - process + subscriptionUrnSelector: + matchLabels: + testing.upbound.io/example-name: example diff --git a/examples-generated/smn/v1alpha1/topic.yaml b/examples-generated/smn/v1alpha1/topic.yaml new file mode 100644 index 0000000..831557e --- /dev/null +++ b/examples-generated/smn/v1alpha1/topic.yaml @@ -0,0 +1,12 @@ +apiVersion: smn.huaweicloud.crossplane.io/v1alpha1 +kind: Topic +metadata: + annotations: + meta.upbound.io/example-id: smn/v1alpha1/topic + labels: + testing.upbound.io/example-name: topic_1 + name: topic-1 +spec: + forProvider: + displayName: The display name of topic_1 + name: topic_1 diff --git a/internal/controller/smn/logtank/zz_controller.go b/internal/controller/smn/logtank/zz_controller.go new file mode 100755 index 0000000..8f8dd2c --- /dev/null +++ b/internal/controller/smn/logtank/zz_controller.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package logtank + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1" + features "github.com/huaweicloud/provider-huaweicloud/internal/features" +) + +// Setup adds a controller that reconciles Logtank managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.Logtank_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.Logtank_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Logtank_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["huaweicloud_smn_logtank"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), + tjcontroller.WithCallbackProvider(ac), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Logtank + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Logtank{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Logtank") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.LogtankList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.LogtankList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Logtank_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Logtank{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/smn/messagedetection/zz_controller.go b/internal/controller/smn/messagedetection/zz_controller.go new file mode 100755 index 0000000..97f1cfa --- /dev/null +++ b/internal/controller/smn/messagedetection/zz_controller.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package messagedetection + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1" + features "github.com/huaweicloud/provider-huaweicloud/internal/features" +) + +// Setup adds a controller that reconciles MessageDetection managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.MessageDetection_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.MessageDetection_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.MessageDetection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["huaweicloud_smn_message_detection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), + tjcontroller.WithCallbackProvider(ac), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.MessageDetection + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.MessageDetection{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.MessageDetection") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.MessageDetectionList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.MessageDetectionList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.MessageDetection_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.MessageDetection{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/smn/messagepublish/zz_controller.go b/internal/controller/smn/messagepublish/zz_controller.go new file mode 100755 index 0000000..fc86b1a --- /dev/null +++ b/internal/controller/smn/messagepublish/zz_controller.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package messagepublish + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1" + features "github.com/huaweicloud/provider-huaweicloud/internal/features" +) + +// Setup adds a controller that reconciles MessagePublish managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.MessagePublish_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.MessagePublish_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.MessagePublish_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["huaweicloud_smn_message_publish"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), + tjcontroller.WithCallbackProvider(ac), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.MessagePublish + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.MessagePublish{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.MessagePublish") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.MessagePublishList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.MessagePublishList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.MessagePublish_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.MessagePublish{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/smn/messagetemplate/zz_controller.go b/internal/controller/smn/messagetemplate/zz_controller.go new file mode 100755 index 0000000..3c12d57 --- /dev/null +++ b/internal/controller/smn/messagetemplate/zz_controller.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package messagetemplate + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1" + features "github.com/huaweicloud/provider-huaweicloud/internal/features" +) + +// Setup adds a controller that reconciles MessageTemplate managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.MessageTemplate_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.MessageTemplate_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.MessageTemplate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["huaweicloud_smn_message_template"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), + tjcontroller.WithCallbackProvider(ac), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.MessageTemplate + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.MessageTemplate{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.MessageTemplate") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.MessageTemplateList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.MessageTemplateList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.MessageTemplate_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.MessageTemplate{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/smn/subscription/zz_controller.go b/internal/controller/smn/subscription/zz_controller.go new file mode 100755 index 0000000..af086af --- /dev/null +++ b/internal/controller/smn/subscription/zz_controller.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package subscription + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1" + features "github.com/huaweicloud/provider-huaweicloud/internal/features" +) + +// Setup adds a controller that reconciles Subscription managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.Subscription_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.Subscription_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Subscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["huaweicloud_smn_subscription"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), + tjcontroller.WithCallbackProvider(ac), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Subscription + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Subscription{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Subscription") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.SubscriptionList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.SubscriptionList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Subscription_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Subscription{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/smn/subscriptionfilterpolicy/zz_controller.go b/internal/controller/smn/subscriptionfilterpolicy/zz_controller.go new file mode 100755 index 0000000..5d110dd --- /dev/null +++ b/internal/controller/smn/subscriptionfilterpolicy/zz_controller.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package subscriptionfilterpolicy + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1" + features "github.com/huaweicloud/provider-huaweicloud/internal/features" +) + +// Setup adds a controller that reconciles SubscriptionFilterPolicy managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.SubscriptionFilterPolicy_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.SubscriptionFilterPolicy_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.SubscriptionFilterPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["huaweicloud_smn_subscription_filter_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), + tjcontroller.WithCallbackProvider(ac), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.SubscriptionFilterPolicy + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.SubscriptionFilterPolicy{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.SubscriptionFilterPolicy") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.SubscriptionFilterPolicyList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.SubscriptionFilterPolicyList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.SubscriptionFilterPolicy_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.SubscriptionFilterPolicy{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/smn/topic/zz_controller.go b/internal/controller/smn/topic/zz_controller.go new file mode 100755 index 0000000..c554420 --- /dev/null +++ b/internal/controller/smn/topic/zz_controller.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package topic + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/huaweicloud/provider-huaweicloud/apis/smn/v1alpha1" + features "github.com/huaweicloud/provider-huaweicloud/internal/features" +) + +// Setup adds a controller that reconciles Topic managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.Topic_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.Topic_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Topic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["huaweicloud_smn_topic"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), + tjcontroller.WithCallbackProvider(ac), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Topic + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Topic{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Topic") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.TopicList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.TopicList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Topic_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Topic{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 7aa70a9..556465a 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -133,6 +133,13 @@ import ( sqlserveraccount "github.com/huaweicloud/provider-huaweicloud/internal/controller/rds/sqlserveraccount" sqlserverdatabase "github.com/huaweicloud/provider-huaweicloud/internal/controller/rds/sqlserverdatabase" sqlserverdatabaseprivilege "github.com/huaweicloud/provider-huaweicloud/internal/controller/rds/sqlserverdatabaseprivilege" + logtank "github.com/huaweicloud/provider-huaweicloud/internal/controller/smn/logtank" + messagedetection "github.com/huaweicloud/provider-huaweicloud/internal/controller/smn/messagedetection" + messagepublish "github.com/huaweicloud/provider-huaweicloud/internal/controller/smn/messagepublish" + messagetemplate "github.com/huaweicloud/provider-huaweicloud/internal/controller/smn/messagetemplate" + subscription "github.com/huaweicloud/provider-huaweicloud/internal/controller/smn/subscription" + subscriptionfilterpolicy "github.com/huaweicloud/provider-huaweicloud/internal/controller/smn/subscriptionfilterpolicy" + topic "github.com/huaweicloud/provider-huaweicloud/internal/controller/smn/topic" imageautosync "github.com/huaweicloud/provider-huaweicloud/internal/controller/swr/imageautosync" imagepermissions "github.com/huaweicloud/provider-huaweicloud/internal/controller/swr/imagepermissions" imageretentionpolicy "github.com/huaweicloud/provider-huaweicloud/internal/controller/swr/imageretentionpolicy" @@ -289,6 +296,13 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { sqlserveraccount.Setup, sqlserverdatabase.Setup, sqlserverdatabaseprivilege.Setup, + logtank.Setup, + messagedetection.Setup, + messagepublish.Setup, + messagetemplate.Setup, + subscription.Setup, + subscriptionfilterpolicy.Setup, + topic.Setup, imageautosync.Setup, imagepermissions.Setup, imageretentionpolicy.Setup, diff --git a/package/crds/smn.huaweicloud.crossplane.io_logtanks.yaml b/package/crds/smn.huaweicloud.crossplane.io_logtanks.yaml new file mode 100644 index 0000000..12a452d --- /dev/null +++ b/package/crds/smn.huaweicloud.crossplane.io_logtanks.yaml @@ -0,0 +1,540 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: logtanks.smn.huaweicloud.crossplane.io +spec: + group: smn.huaweicloud.crossplane.io + names: + categories: + - crossplane + - managed + - huaweicloud + kind: Logtank + listKind: LogtankList + plural: logtanks + singular: logtank + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: Logtank is the Schema for the Logtanks API. "" + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: LogtankSpec defines the desired state of Logtank + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + logGroupId: + description: The lts log group ID. + type: string + logStreamId: + description: The lts log stream ID. + type: string + region: + description: |- + The region in which to create the SMN logtank resource. If omitted, the + provider-level region will be used. Changing this parameter will create a new resource. + type: string + topicUrn: + description: |- + Resource identifier of a topic, which is unique. + Changing this parameter will create a new resource. + type: string + topicUrnRef: + description: Reference to a Topic in smn to populate topicUrn. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + topicUrnSelector: + description: Selector for a Topic in smn to populate topicUrn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + logGroupId: + description: The lts log group ID. + type: string + logStreamId: + description: The lts log stream ID. + type: string + region: + description: |- + The region in which to create the SMN logtank resource. If omitted, the + provider-level region will be used. Changing this parameter will create a new resource. + type: string + topicUrn: + description: |- + Resource identifier of a topic, which is unique. + Changing this parameter will create a new resource. + type: string + topicUrnRef: + description: Reference to a Topic in smn to populate topicUrn. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + topicUrnSelector: + description: Selector for a Topic in smn to populate topicUrn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: |- + PublishConnectionDetailsTo specifies the connection secret config which + contains a name, metadata and a reference to secret store config to + which any connection details for this managed resource should be written. + Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: |- + SecretStoreConfigRef specifies which secret store config should be used + for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations are the annotations to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.annotations". + - It is up to Secret Store implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: |- + Labels are the labels/tags to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store types. + type: object + type: + description: |- + Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.logGroupId is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.logGroupId) + || (has(self.initProvider) && has(self.initProvider.logGroupId))' + - message: spec.forProvider.logStreamId is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.logStreamId) + || (has(self.initProvider) && has(self.initProvider.logStreamId))' + status: + description: LogtankStatus defines the observed state of Logtank. + properties: + atProvider: + properties: + createdAt: + description: Time when the logtank was created. + type: string + id: + description: The resource ID. The value is the topic URN. + type: string + logGroupId: + description: The lts log group ID. + type: string + logStreamId: + description: The lts log stream ID. + type: string + logtankId: + description: The ID of the logtank. + type: string + region: + description: |- + The region in which to create the SMN logtank resource. If omitted, the + provider-level region will be used. Changing this parameter will create a new resource. + type: string + topicUrn: + description: |- + Resource identifier of a topic, which is unique. + Changing this parameter will create a new resource. + type: string + updatedAt: + description: Time when the logtank was updated. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/smn.huaweicloud.crossplane.io_messagedetections.yaml b/package/crds/smn.huaweicloud.crossplane.io_messagedetections.yaml new file mode 100644 index 0000000..baa15da --- /dev/null +++ b/package/crds/smn.huaweicloud.crossplane.io_messagedetections.yaml @@ -0,0 +1,591 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: messagedetections.smn.huaweicloud.crossplane.io +spec: + group: smn.huaweicloud.crossplane.io + names: + categories: + - crossplane + - managed + - huaweicloud + kind: MessageDetection + listKind: MessageDetectionList + plural: messagedetections + singular: messagedetection + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: MessageDetection is the Schema for the MessageDetections API. + Manages a SMN message detection resource within HuaweiCloud. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: MessageDetectionSpec defines the desired state of MessageDetection + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + enableForceNew: + type: string + endpoint: + description: |- + Specifies the endpoint address to be detected. + The address must start with http:// or https:// and cannot be left blank. + Specifies the endpoint address to be detected. + type: string + extension: + additionalProperties: + type: string + description: |- + Specifies the extended key/value for subscriptions over HTTP or HTTPS. + These key/value pairs will be carried as the request header when HTTP or HTTPS messages are sent. + The key/value must meet the following requirements: + Specifies the extended key/value for subscriptions over HTTP or HTTPS. + type: object + x-kubernetes-map-type: granular + protocol: + description: |- + Specifies the protocol type. The value can be http or https. + Specifies the protocol type. + type: string + region: + description: |- + Specifies the region in which to create the resource. + If omitted, the provider-level region will be used. + Changing this creates a new resource. + type: string + topicUrn: + description: |- + Specifies the resource identifier of a topic. + Specifies the resource identifier of a topic. + type: string + topicUrnRef: + description: Reference to a Topic in smn to populate topicUrn. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + topicUrnSelector: + description: Selector for a Topic in smn to populate topicUrn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + enableForceNew: + type: string + endpoint: + description: |- + Specifies the endpoint address to be detected. + The address must start with http:// or https:// and cannot be left blank. + Specifies the endpoint address to be detected. + type: string + extension: + additionalProperties: + type: string + description: |- + Specifies the extended key/value for subscriptions over HTTP or HTTPS. + These key/value pairs will be carried as the request header when HTTP or HTTPS messages are sent. + The key/value must meet the following requirements: + Specifies the extended key/value for subscriptions over HTTP or HTTPS. + type: object + x-kubernetes-map-type: granular + protocol: + description: |- + Specifies the protocol type. The value can be http or https. + Specifies the protocol type. + type: string + region: + description: |- + Specifies the region in which to create the resource. + If omitted, the provider-level region will be used. + Changing this creates a new resource. + type: string + topicUrn: + description: |- + Specifies the resource identifier of a topic. + Specifies the resource identifier of a topic. + type: string + topicUrnRef: + description: Reference to a Topic in smn to populate topicUrn. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + topicUrnSelector: + description: Selector for a Topic in smn to populate topicUrn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: |- + PublishConnectionDetailsTo specifies the connection secret config which + contains a name, metadata and a reference to secret store config to + which any connection details for this managed resource should be written. + Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: |- + SecretStoreConfigRef specifies which secret store config should be used + for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations are the annotations to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.annotations". + - It is up to Secret Store implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: |- + Labels are the labels/tags to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store types. + type: object + type: + description: |- + Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.endpoint is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.endpoint) + || (has(self.initProvider) && has(self.initProvider.endpoint))' + - message: spec.forProvider.protocol is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.protocol) + || (has(self.initProvider) && has(self.initProvider.protocol))' + status: + description: MessageDetectionStatus defines the observed state of MessageDetection. + properties: + atProvider: + properties: + enableForceNew: + type: string + endpoint: + description: |- + Specifies the endpoint address to be detected. + The address must start with http:// or https:// and cannot be left blank. + Specifies the endpoint address to be detected. + type: string + extension: + additionalProperties: + type: string + description: |- + Specifies the extended key/value for subscriptions over HTTP or HTTPS. + These key/value pairs will be carried as the request header when HTTP or HTTPS messages are sent. + The key/value must meet the following requirements: + Specifies the extended key/value for subscriptions over HTTP or HTTPS. + type: object + x-kubernetes-map-type: granular + id: + description: The resource ID. + type: string + protocol: + description: |- + Specifies the protocol type. The value can be http or https. + Specifies the protocol type. + type: string + region: + description: |- + Specifies the region in which to create the resource. + If omitted, the provider-level region will be used. + Changing this creates a new resource. + type: string + result: + description: |- + The message detection result. + The message detection result. + type: string + topicUrn: + description: |- + Specifies the resource identifier of a topic. + Specifies the resource identifier of a topic. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/smn.huaweicloud.crossplane.io_messagepublishes.yaml b/package/crds/smn.huaweicloud.crossplane.io_messagepublishes.yaml new file mode 100644 index 0000000..87d6b23 --- /dev/null +++ b/package/crds/smn.huaweicloud.crossplane.io_messagepublishes.yaml @@ -0,0 +1,736 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: messagepublishes.smn.huaweicloud.crossplane.io +spec: + group: smn.huaweicloud.crossplane.io + names: + categories: + - crossplane + - managed + - huaweicloud + kind: MessagePublish + listKind: MessagePublishList + plural: messagepublishes + singular: messagepublish + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: MessagePublish is the Schema for the MessagePublishs API. Manages + a SMN message publishment resource within HuaweiCloud. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: MessagePublishSpec defines the desired state of MessagePublish + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + enableForceNew: + type: string + message: + description: |- + Specifies the message content. + Specifies the message content. + type: string + messageAttributes: + description: |- + Specifies the message filter policies of a subscriber. + The message_attributes structure is documented below. + Specifies the message filter policies of a subscriber. + items: + properties: + name: + description: |- + Specifies the property name. + Specifies the property name. + type: string + type: + description: |- + Specifies the property type. + The value can be STRING, STRING_ARRAY or PROTOCOL. + Specifies the property type. + type: string + value: + description: |- + Specifies the property value. + This parameter is valid only when the type set to STRING. The attribute value can only contain Chinese + and English, numbers, and underscores, and the length is 1 to 32 characters. + Specifies the property value. + type: string + values: + description: |- + Specifies the property values. + This parameter is valid when the type set to STRING_ARRAY or PROTOCOL. + Specifies the property values. + items: + type: string + type: array + type: object + type: array + messageStructure: + description: |- + Specifies the message structure. + Specifies the message structure. + type: string + messageTemplateName: + description: |- + Specifies the message template name. + Specifies the message template name. + type: string + region: + description: |- + Specifies the region in which to create the resource. + If omitted, the provider-level region will be used. + Changing this creates a new resource. + type: string + subject: + description: |- + Specifies the message title. + Specifies the message title. + type: string + tags: + additionalProperties: + type: string + description: |- + Specifies a dictionary consisting of tag and parameters to replace the tag. + The value corresponding to the label in the message template. Message publishing using message template mode must + carry this parameter. The key in the dictionary is the parameter name in the message template, which should not + exceed 21 characters. The value in the dictionary is the value after replacing the parameters in the message + template, which does not exceed 1KB. + Specifies a dictionary consisting of tag and parameters to replace the tag. + type: object + x-kubernetes-map-type: granular + timeToLive: + description: |- + Specifies the maximum retention time of the message within the SMN system. + After this retention time, the system will no longer send the message. The unit is second, and the default value + of the variable is 3600 second. The value is a positive integer and less than or equal to 3600*24. + Specifies the maximum retention time of the message within the SMN system. + type: string + topicUrn: + description: |- + Specifies the resource identifier of a topic. + Specifies the resource identifier of a topic. + type: string + topicUrnRef: + description: Reference to a Topic in smn to populate topicUrn. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + topicUrnSelector: + description: Selector for a Topic in smn to populate topicUrn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + enableForceNew: + type: string + message: + description: |- + Specifies the message content. + Specifies the message content. + type: string + messageAttributes: + description: |- + Specifies the message filter policies of a subscriber. + The message_attributes structure is documented below. + Specifies the message filter policies of a subscriber. + items: + properties: + name: + description: |- + Specifies the property name. + Specifies the property name. + type: string + type: + description: |- + Specifies the property type. + The value can be STRING, STRING_ARRAY or PROTOCOL. + Specifies the property type. + type: string + value: + description: |- + Specifies the property value. + This parameter is valid only when the type set to STRING. The attribute value can only contain Chinese + and English, numbers, and underscores, and the length is 1 to 32 characters. + Specifies the property value. + type: string + values: + description: |- + Specifies the property values. + This parameter is valid when the type set to STRING_ARRAY or PROTOCOL. + Specifies the property values. + items: + type: string + type: array + type: object + type: array + messageStructure: + description: |- + Specifies the message structure. + Specifies the message structure. + type: string + messageTemplateName: + description: |- + Specifies the message template name. + Specifies the message template name. + type: string + region: + description: |- + Specifies the region in which to create the resource. + If omitted, the provider-level region will be used. + Changing this creates a new resource. + type: string + subject: + description: |- + Specifies the message title. + Specifies the message title. + type: string + tags: + additionalProperties: + type: string + description: |- + Specifies a dictionary consisting of tag and parameters to replace the tag. + The value corresponding to the label in the message template. Message publishing using message template mode must + carry this parameter. The key in the dictionary is the parameter name in the message template, which should not + exceed 21 characters. The value in the dictionary is the value after replacing the parameters in the message + template, which does not exceed 1KB. + Specifies a dictionary consisting of tag and parameters to replace the tag. + type: object + x-kubernetes-map-type: granular + timeToLive: + description: |- + Specifies the maximum retention time of the message within the SMN system. + After this retention time, the system will no longer send the message. The unit is second, and the default value + of the variable is 3600 second. The value is a positive integer and less than or equal to 3600*24. + Specifies the maximum retention time of the message within the SMN system. + type: string + topicUrn: + description: |- + Specifies the resource identifier of a topic. + Specifies the resource identifier of a topic. + type: string + topicUrnRef: + description: Reference to a Topic in smn to populate topicUrn. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + topicUrnSelector: + description: Selector for a Topic in smn to populate topicUrn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: |- + PublishConnectionDetailsTo specifies the connection secret config which + contains a name, metadata and a reference to secret store config to + which any connection details for this managed resource should be written. + Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: |- + SecretStoreConfigRef specifies which secret store config should be used + for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations are the annotations to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.annotations". + - It is up to Secret Store implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: |- + Labels are the labels/tags to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store types. + type: object + type: + description: |- + Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + status: + description: MessagePublishStatus defines the observed state of MessagePublish. + properties: + atProvider: + properties: + enableForceNew: + type: string + id: + description: The resource ID. + type: string + message: + description: |- + Specifies the message content. + Specifies the message content. + type: string + messageAttributes: + description: |- + Specifies the message filter policies of a subscriber. + The message_attributes structure is documented below. + Specifies the message filter policies of a subscriber. + items: + properties: + name: + description: |- + Specifies the property name. + Specifies the property name. + type: string + type: + description: |- + Specifies the property type. + The value can be STRING, STRING_ARRAY or PROTOCOL. + Specifies the property type. + type: string + value: + description: |- + Specifies the property value. + This parameter is valid only when the type set to STRING. The attribute value can only contain Chinese + and English, numbers, and underscores, and the length is 1 to 32 characters. + Specifies the property value. + type: string + values: + description: |- + Specifies the property values. + This parameter is valid when the type set to STRING_ARRAY or PROTOCOL. + Specifies the property values. + items: + type: string + type: array + type: object + type: array + messageStructure: + description: |- + Specifies the message structure. + Specifies the message structure. + type: string + messageTemplateName: + description: |- + Specifies the message template name. + Specifies the message template name. + type: string + region: + description: |- + Specifies the region in which to create the resource. + If omitted, the provider-level region will be used. + Changing this creates a new resource. + type: string + subject: + description: |- + Specifies the message title. + Specifies the message title. + type: string + tags: + additionalProperties: + type: string + description: |- + Specifies a dictionary consisting of tag and parameters to replace the tag. + The value corresponding to the label in the message template. Message publishing using message template mode must + carry this parameter. The key in the dictionary is the parameter name in the message template, which should not + exceed 21 characters. The value in the dictionary is the value after replacing the parameters in the message + template, which does not exceed 1KB. + Specifies a dictionary consisting of tag and parameters to replace the tag. + type: object + x-kubernetes-map-type: granular + timeToLive: + description: |- + Specifies the maximum retention time of the message within the SMN system. + After this retention time, the system will no longer send the message. The unit is second, and the default value + of the variable is 3600 second. The value is a positive integer and less than or equal to 3600*24. + Specifies the maximum retention time of the message within the SMN system. + type: string + topicUrn: + description: |- + Specifies the resource identifier of a topic. + Specifies the resource identifier of a topic. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/smn.huaweicloud.crossplane.io_messagetemplates.yaml b/package/crds/smn.huaweicloud.crossplane.io_messagetemplates.yaml new file mode 100644 index 0000000..16786d5 --- /dev/null +++ b/package/crds/smn.huaweicloud.crossplane.io_messagetemplates.yaml @@ -0,0 +1,422 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: messagetemplates.smn.huaweicloud.crossplane.io +spec: + group: smn.huaweicloud.crossplane.io + names: + categories: + - crossplane + - managed + - huaweicloud + kind: MessageTemplate + listKind: MessageTemplateList + plural: messagetemplates + singular: messagetemplate + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: MessageTemplate is the Schema for the MessageTemplates API. "" + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: MessageTemplateSpec defines the desired state of MessageTemplate + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + content: + description: |- + Specifies the template content, which supports plain text only. + The template content cannot be left blank or larger than 256 KB. + The fields within "{}" can be replaced based on the actual situation + when you use the template. + Specifies the template content, which supports plain text only. + type: string + name: + description: |- + Specifies the message template name. + A template name starts with a letter or digit, consists of 1 to 64 characters, + and can contain only letters, digits, hyphens (-), and underscores (_). + Specifies the message template name. + type: string + protocol: + description: |- + Specifies the protocol supported by the template. Value options: + Specifies the protocol supported by the template. + type: string + region: + description: |- + Specifies the region in which to create the resource. + If omitted, the provider-level region will be used. Changing this parameter will create a new resource. + type: string + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + content: + description: |- + Specifies the template content, which supports plain text only. + The template content cannot be left blank or larger than 256 KB. + The fields within "{}" can be replaced based on the actual situation + when you use the template. + Specifies the template content, which supports plain text only. + type: string + name: + description: |- + Specifies the message template name. + A template name starts with a letter or digit, consists of 1 to 64 characters, + and can contain only letters, digits, hyphens (-), and underscores (_). + Specifies the message template name. + type: string + protocol: + description: |- + Specifies the protocol supported by the template. Value options: + Specifies the protocol supported by the template. + type: string + region: + description: |- + Specifies the region in which to create the resource. + If omitted, the provider-level region will be used. Changing this parameter will create a new resource. + type: string + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: |- + PublishConnectionDetailsTo specifies the connection secret config which + contains a name, metadata and a reference to secret store config to + which any connection details for this managed resource should be written. + Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: |- + SecretStoreConfigRef specifies which secret store config should be used + for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations are the annotations to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.annotations". + - It is up to Secret Store implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: |- + Labels are the labels/tags to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store types. + type: object + type: + description: |- + Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.content is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.content) + || (has(self.initProvider) && has(self.initProvider.content))' + - message: spec.forProvider.name is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.name) + || (has(self.initProvider) && has(self.initProvider.name))' + - message: spec.forProvider.protocol is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.protocol) + || (has(self.initProvider) && has(self.initProvider.protocol))' + status: + description: MessageTemplateStatus defines the observed state of MessageTemplate. + properties: + atProvider: + properties: + content: + description: |- + Specifies the template content, which supports plain text only. + The template content cannot be left blank or larger than 256 KB. + The fields within "{}" can be replaced based on the actual situation + when you use the template. + Specifies the template content, which supports plain text only. + type: string + id: + description: The resource ID. + type: string + name: + description: |- + Specifies the message template name. + A template name starts with a letter or digit, consists of 1 to 64 characters, + and can contain only letters, digits, hyphens (-), and underscores (_). + Specifies the message template name. + type: string + protocol: + description: |- + Specifies the protocol supported by the template. Value options: + Specifies the protocol supported by the template. + type: string + region: + description: |- + Specifies the region in which to create the resource. + If omitted, the provider-level region will be used. Changing this parameter will create a new resource. + type: string + tagNames: + description: |- + Indicates the variable list. The variable name will be quoted in braces ({}) in the template. + When you use a template to send messages, you can replace the variable with any content. + Indicates the variable list. + items: + type: string + type: array + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/smn.huaweicloud.crossplane.io_subscriptionfilterpolicies.yaml b/package/crds/smn.huaweicloud.crossplane.io_subscriptionfilterpolicies.yaml new file mode 100644 index 0000000..b0318e9 --- /dev/null +++ b/package/crds/smn.huaweicloud.crossplane.io_subscriptionfilterpolicies.yaml @@ -0,0 +1,593 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: subscriptionfilterpolicies.smn.huaweicloud.crossplane.io +spec: + group: smn.huaweicloud.crossplane.io + names: + categories: + - crossplane + - managed + - huaweicloud + kind: SubscriptionFilterPolicy + listKind: SubscriptionFilterPolicyList + plural: subscriptionfilterpolicies + singular: subscriptionfilterpolicy + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: SubscriptionFilterPolicy is the Schema for the SubscriptionFilterPolicys + API. Manages an SMN subscription filter policy resource within HuaweiCloud. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: SubscriptionFilterPolicySpec defines the desired state of + SubscriptionFilterPolicy + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + enableForceNew: + type: string + filterPolicies: + description: |- + Specifies the message filter policies of a subscriber. + The filter_policies structure is documented below. + Specifies the message filter policies of a subscriber. + items: + properties: + name: + description: |- + Specifies the filter policy name. The policy name must be unique. + Specifies the filter policy name. The policy name must be unique. + type: string + stringEquals: + description: |- + Specifies the string array for exact match. The array can contain 1 + to 10 strings. The array content must be unique. The string cannot be null or an empty string "". + A string can contain 1 to 32 characters, including letters, digits, and underscores (_). + Specifies the string array for exact match. + items: + type: string + type: array + x-kubernetes-list-type: set + type: object + type: array + region: + description: |- + Specifies the region in which to create the resource. + If omitted, the provider-level region will be used. + Changing this creates a new resource. + type: string + subscriptionUrn: + description: |- + Specifies the resource identifier of the subscriber. + Specifies the resource identifier of the subscriber. + type: string + subscriptionUrnRef: + description: Reference to a Subscription in smn to populate subscriptionUrn. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + subscriptionUrnSelector: + description: Selector for a Subscription in smn to populate subscriptionUrn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + enableForceNew: + type: string + filterPolicies: + description: |- + Specifies the message filter policies of a subscriber. + The filter_policies structure is documented below. + Specifies the message filter policies of a subscriber. + items: + properties: + name: + description: |- + Specifies the filter policy name. The policy name must be unique. + Specifies the filter policy name. The policy name must be unique. + type: string + stringEquals: + description: |- + Specifies the string array for exact match. The array can contain 1 + to 10 strings. The array content must be unique. The string cannot be null or an empty string "". + A string can contain 1 to 32 characters, including letters, digits, and underscores (_). + Specifies the string array for exact match. + items: + type: string + type: array + x-kubernetes-list-type: set + type: object + type: array + region: + description: |- + Specifies the region in which to create the resource. + If omitted, the provider-level region will be used. + Changing this creates a new resource. + type: string + subscriptionUrn: + description: |- + Specifies the resource identifier of the subscriber. + Specifies the resource identifier of the subscriber. + type: string + subscriptionUrnRef: + description: Reference to a Subscription in smn to populate subscriptionUrn. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + subscriptionUrnSelector: + description: Selector for a Subscription in smn to populate subscriptionUrn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: |- + PublishConnectionDetailsTo specifies the connection secret config which + contains a name, metadata and a reference to secret store config to + which any connection details for this managed resource should be written. + Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: |- + SecretStoreConfigRef specifies which secret store config should be used + for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations are the annotations to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.annotations". + - It is up to Secret Store implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: |- + Labels are the labels/tags to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store types. + type: object + type: + description: |- + Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.filterPolicies is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.filterPolicies) + || (has(self.initProvider) && has(self.initProvider.filterPolicies))' + status: + description: SubscriptionFilterPolicyStatus defines the observed state + of SubscriptionFilterPolicy. + properties: + atProvider: + properties: + enableForceNew: + type: string + filterPolicies: + description: |- + Specifies the message filter policies of a subscriber. + The filter_policies structure is documented below. + Specifies the message filter policies of a subscriber. + items: + properties: + name: + description: |- + Specifies the filter policy name. The policy name must be unique. + Specifies the filter policy name. The policy name must be unique. + type: string + stringEquals: + description: |- + Specifies the string array for exact match. The array can contain 1 + to 10 strings. The array content must be unique. The string cannot be null or an empty string "". + A string can contain 1 to 32 characters, including letters, digits, and underscores (_). + Specifies the string array for exact match. + items: + type: string + type: array + x-kubernetes-list-type: set + type: object + type: array + id: + description: The resource ID. + type: string + region: + description: |- + Specifies the region in which to create the resource. + If omitted, the provider-level region will be used. + Changing this creates a new resource. + type: string + subscriptionUrn: + description: |- + Specifies the resource identifier of the subscriber. + Specifies the resource identifier of the subscriber. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/smn.huaweicloud.crossplane.io_subscriptions.yaml b/package/crds/smn.huaweicloud.crossplane.io_subscriptions.yaml new file mode 100644 index 0000000..f73957b --- /dev/null +++ b/package/crds/smn.huaweicloud.crossplane.io_subscriptions.yaml @@ -0,0 +1,692 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: subscriptions.smn.huaweicloud.crossplane.io +spec: + group: smn.huaweicloud.crossplane.io + names: + categories: + - crossplane + - managed + - huaweicloud + kind: Subscription + listKind: SubscriptionList + plural: subscriptions + singular: subscription + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: Subscription is the Schema for the Subscriptions API. "" + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: SubscriptionSpec defines the desired state of Subscription + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + endpoint: + description: Message endpoint. Changing this parameter will create + a new resource. + type: string + extension: + description: |- + Specifies the extension configurations. + The extension structure is documented below. + Changing this parameter will create a new resource. + items: + properties: + clientId: + description: |- + Specifies the client ID. This field is the tenant ID field in + the WeLink subscription and is obtained by the tenant from WeLink. This field is mandatory when protocol + is set to welink. Changing this parameter will create a new resource. + type: string + clientSecret: + description: |- + Specifies the client secret. This field is the client secret + field obtained by the tenant from WeLink. This field is mandatory when protocol is set to welink. + Changing this parameter will create a new resource. + type: string + keyword: + description: |- + Specifies the keyword. When protocol is set to feishu, + either keyword or sign_secret must be specified. When you use keywords to configure a security policy + for the Lark or DingTalk chatbot on SMN, the keywords must have one of the keywords configured on the Lark + or DingTalk client. Changing this parameter will create a new resource. + type: string + signSecret: + description: |- + Specifies the key including signature. When protocol is set + to feishu or dingding, this field or keyword must be specified. The key configurations must be + the same as those on the Lark or DingTalk client. For example, if only key is configured on the Lark client, + enter the key field obtained from the Lark client. If only keyword is configured on the Lark client, skip this field. + Changing this parameter will create a new resource. + type: string + type: object + type: array + protocol: + description: |- + Specifies the protocol of the message endpoint. Currently, email, + sms, http, https, functionstage, functiongraph, callnotify, wechat, dingding, + feishu and welink are supported. Changing this parameter will create a new resource. + type: string + region: + description: |- + The region in which to create the SMN subscription resource. If omitted, the + provider-level region will be used. Changing this parameter will create a new resource. + type: string + remark: + description: |- + Remark information. The remarks must be a UTF-8-coded character string + containing 128 bytes. Changing this parameter will create a new resource. + type: string + topicUrn: + description: |- + Specifies the resource identifier of a topic, which is unique. + Changing this parameter will create a new resource. + type: string + topicUrnRef: + description: Reference to a Topic in smn to populate topicUrn. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + topicUrnSelector: + description: Selector for a Topic in smn to populate topicUrn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + endpoint: + description: Message endpoint. Changing this parameter will create + a new resource. + type: string + extension: + description: |- + Specifies the extension configurations. + The extension structure is documented below. + Changing this parameter will create a new resource. + items: + properties: + clientId: + description: |- + Specifies the client ID. This field is the tenant ID field in + the WeLink subscription and is obtained by the tenant from WeLink. This field is mandatory when protocol + is set to welink. Changing this parameter will create a new resource. + type: string + clientSecret: + description: |- + Specifies the client secret. This field is the client secret + field obtained by the tenant from WeLink. This field is mandatory when protocol is set to welink. + Changing this parameter will create a new resource. + type: string + keyword: + description: |- + Specifies the keyword. When protocol is set to feishu, + either keyword or sign_secret must be specified. When you use keywords to configure a security policy + for the Lark or DingTalk chatbot on SMN, the keywords must have one of the keywords configured on the Lark + or DingTalk client. Changing this parameter will create a new resource. + type: string + signSecret: + description: |- + Specifies the key including signature. When protocol is set + to feishu or dingding, this field or keyword must be specified. The key configurations must be + the same as those on the Lark or DingTalk client. For example, if only key is configured on the Lark client, + enter the key field obtained from the Lark client. If only keyword is configured on the Lark client, skip this field. + Changing this parameter will create a new resource. + type: string + type: object + type: array + protocol: + description: |- + Specifies the protocol of the message endpoint. Currently, email, + sms, http, https, functionstage, functiongraph, callnotify, wechat, dingding, + feishu and welink are supported. Changing this parameter will create a new resource. + type: string + region: + description: |- + The region in which to create the SMN subscription resource. If omitted, the + provider-level region will be used. Changing this parameter will create a new resource. + type: string + remark: + description: |- + Remark information. The remarks must be a UTF-8-coded character string + containing 128 bytes. Changing this parameter will create a new resource. + type: string + topicUrn: + description: |- + Specifies the resource identifier of a topic, which is unique. + Changing this parameter will create a new resource. + type: string + topicUrnRef: + description: Reference to a Topic in smn to populate topicUrn. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + topicUrnSelector: + description: Selector for a Topic in smn to populate topicUrn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: |- + PublishConnectionDetailsTo specifies the connection secret config which + contains a name, metadata and a reference to secret store config to + which any connection details for this managed resource should be written. + Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: |- + SecretStoreConfigRef specifies which secret store config should be used + for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations are the annotations to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.annotations". + - It is up to Secret Store implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: |- + Labels are the labels/tags to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store types. + type: object + type: + description: |- + Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.endpoint is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.endpoint) + || (has(self.initProvider) && has(self.initProvider.endpoint))' + - message: spec.forProvider.protocol is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.protocol) + || (has(self.initProvider) && has(self.initProvider.protocol))' + status: + description: SubscriptionStatus defines the observed state of Subscription. + properties: + atProvider: + properties: + endpoint: + description: Message endpoint. Changing this parameter will create + a new resource. + type: string + extension: + description: |- + Specifies the extension configurations. + The extension structure is documented below. + Changing this parameter will create a new resource. + items: + properties: + clientId: + description: |- + Specifies the client ID. This field is the tenant ID field in + the WeLink subscription and is obtained by the tenant from WeLink. This field is mandatory when protocol + is set to welink. Changing this parameter will create a new resource. + type: string + clientSecret: + description: |- + Specifies the client secret. This field is the client secret + field obtained by the tenant from WeLink. This field is mandatory when protocol is set to welink. + Changing this parameter will create a new resource. + type: string + keyword: + description: |- + Specifies the keyword. When protocol is set to feishu, + either keyword or sign_secret must be specified. When you use keywords to configure a security policy + for the Lark or DingTalk chatbot on SMN, the keywords must have one of the keywords configured on the Lark + or DingTalk client. Changing this parameter will create a new resource. + type: string + signSecret: + description: |- + Specifies the key including signature. When protocol is set + to feishu or dingding, this field or keyword must be specified. The key configurations must be + the same as those on the Lark or DingTalk client. For example, if only key is configured on the Lark client, + enter the key field obtained from the Lark client. If only keyword is configured on the Lark client, skip this field. + Changing this parameter will create a new resource. + type: string + type: object + type: array + filterPolicies: + description: |- + The message filter policies of a subscriber. + The filter_policies structure is documented below. + The message filter policies of a subscriber. + items: + properties: + name: + description: The filter policy name. + type: string + stringEquals: + description: The string array for exact match. + items: + type: string + type: array + type: object + type: array + id: + description: The resource ID. The value is the subscription urn. + type: string + owner: + description: Project ID of the topic creator. + type: string + protocol: + description: |- + Specifies the protocol of the message endpoint. Currently, email, + sms, http, https, functionstage, functiongraph, callnotify, wechat, dingding, + feishu and welink are supported. Changing this parameter will create a new resource. + type: string + region: + description: |- + The region in which to create the SMN subscription resource. If omitted, the + provider-level region will be used. Changing this parameter will create a new resource. + type: string + remark: + description: |- + Remark information. The remarks must be a UTF-8-coded character string + containing 128 bytes. Changing this parameter will create a new resource. + type: string + status: + description: Subscription status. + type: number + subscriptionUrn: + description: Resource identifier of a subscription, which is unique. + type: string + topicUrn: + description: |- + Specifies the resource identifier of a topic, which is unique. + Changing this parameter will create a new resource. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/smn.huaweicloud.crossplane.io_topics.yaml b/package/crds/smn.huaweicloud.crossplane.io_topics.yaml new file mode 100644 index 0000000..f24ccda --- /dev/null +++ b/package/crds/smn.huaweicloud.crossplane.io_topics.yaml @@ -0,0 +1,487 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: topics.smn.huaweicloud.crossplane.io +spec: + group: smn.huaweicloud.crossplane.io + names: + categories: + - crossplane + - managed + - huaweicloud + kind: Topic + listKind: TopicList + plural: topics + singular: topic + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: Topic is the Schema for the Topics API. "" + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: TopicSpec defines the desired state of Topic + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + accessPolicy: + description: 'schema: Internal' + type: string + displayName: + description: |- + Specifies the topic display name, which is presented as the name of the email + sender in an email message. The name can contains of 0 to 192 characters. + type: string + enterpriseProjectId: + description: |- + Specifies the enterprise project id of the SMN Topic, Value 0 + indicates the default enterprise project. Changing this parameter will create a new resource. + type: string + introduction: + description: |- + Specifies the introduction of the topic, + this will be contained in the subscription invitation. + type: string + name: + description: |- + Specifies the name of the topic to be created. The name can contains of 1 to 255 + characters and must start with a letter or digit, and can only contain letters, digits, underscores (_), and hyphens (-). + Changing this parameter will create a new resource. + type: string + region: + description: |- + The region in which to create the SMN topic resource. If omitted, the + provider-level region will be used. Changing this parameter will create a new resource. + type: string + servicesPublishAllowed: + description: |- + Specifies the services that can publish messages to this topic + separated by comma(,). If left empty, that means no service allowed. + type: string + tags: + additionalProperties: + type: string + description: Specifies the tags of the SMN topic, key/value pair + format. + type: object + x-kubernetes-map-type: granular + usersPublishAllowed: + description: |- + Specifies the users who can publish messages to this topic. + The value can be * which indicates all users or user account URNs separated by comma(,). The format of + user account URN is urn:csp:iam::domainId:root. domainId indicates the account ID of another user. + If left empty, that means only the topic creator can publish messages. + type: string + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + accessPolicy: + description: 'schema: Internal' + type: string + displayName: + description: |- + Specifies the topic display name, which is presented as the name of the email + sender in an email message. The name can contains of 0 to 192 characters. + type: string + enterpriseProjectId: + description: |- + Specifies the enterprise project id of the SMN Topic, Value 0 + indicates the default enterprise project. Changing this parameter will create a new resource. + type: string + introduction: + description: |- + Specifies the introduction of the topic, + this will be contained in the subscription invitation. + type: string + name: + description: |- + Specifies the name of the topic to be created. The name can contains of 1 to 255 + characters and must start with a letter or digit, and can only contain letters, digits, underscores (_), and hyphens (-). + Changing this parameter will create a new resource. + type: string + region: + description: |- + The region in which to create the SMN topic resource. If omitted, the + provider-level region will be used. Changing this parameter will create a new resource. + type: string + servicesPublishAllowed: + description: |- + Specifies the services that can publish messages to this topic + separated by comma(,). If left empty, that means no service allowed. + type: string + tags: + additionalProperties: + type: string + description: Specifies the tags of the SMN topic, key/value pair + format. + type: object + x-kubernetes-map-type: granular + usersPublishAllowed: + description: |- + Specifies the users who can publish messages to this topic. + The value can be * which indicates all users or user account URNs separated by comma(,). The format of + user account URN is urn:csp:iam::domainId:root. domainId indicates the account ID of another user. + If left empty, that means only the topic creator can publish messages. + type: string + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: |- + PublishConnectionDetailsTo specifies the connection secret config which + contains a name, metadata and a reference to secret store config to + which any connection details for this managed resource should be written. + Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: |- + SecretStoreConfigRef specifies which secret store config should be used + for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations are the annotations to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.annotations". + - It is up to Secret Store implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: |- + Labels are the labels/tags to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store types. + type: object + type: + description: |- + Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.name is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.name) + || (has(self.initProvider) && has(self.initProvider.name))' + status: + description: TopicStatus defines the observed state of Topic. + properties: + atProvider: + properties: + accessPolicy: + description: 'schema: Internal' + type: string + createTime: + description: Time when the topic was created. + type: string + displayName: + description: |- + Specifies the topic display name, which is presented as the name of the email + sender in an email message. The name can contains of 0 to 192 characters. + type: string + enterpriseProjectId: + description: |- + Specifies the enterprise project id of the SMN Topic, Value 0 + indicates the default enterprise project. Changing this parameter will create a new resource. + type: string + id: + description: The resource ID. The value is the topic urn. + type: string + introduction: + description: |- + Specifies the introduction of the topic, + this will be contained in the subscription invitation. + type: string + name: + description: |- + Specifies the name of the topic to be created. The name can contains of 1 to 255 + characters and must start with a letter or digit, and can only contain letters, digits, underscores (_), and hyphens (-). + Changing this parameter will create a new resource. + type: string + pushPolicy: + description: Message pushing policy. + type: number + region: + description: |- + The region in which to create the SMN topic resource. If omitted, the + provider-level region will be used. Changing this parameter will create a new resource. + type: string + servicesPublishAllowed: + description: |- + Specifies the services that can publish messages to this topic + separated by comma(,). If left empty, that means no service allowed. + type: string + tags: + additionalProperties: + type: string + description: Specifies the tags of the SMN topic, key/value pair + format. + type: object + x-kubernetes-map-type: granular + topicUrn: + description: Resource identifier of a topic, which is unique. + type: string + updateTime: + description: Time when the topic was updated. + type: string + usersPublishAllowed: + description: |- + Specifies the users who can publish messages to this topic. + The value can be * which indicates all users or user account URNs separated by comma(,). The format of + user account URN is urn:csp:iam::domainId:root. domainId indicates the account ID of another user. + If left empty, that means only the topic creator can publish messages. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {}