github.com/argoproj-labs/argocd-operator@v0.10.0/api/v1alpha1/notificationsconfiguration_types.go (about)

     1  /*
     2  Copyright 2021.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package v1alpha1
    18  
    19  import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    20  
    21  func init() {
    22  	SchemeBuilder.Register(&NotificationsConfiguration{}, &NotificationsConfigurationList{})
    23  }
    24  
    25  //+kubebuilder:object:root=true
    26  
    27  // NotificationsConfiguration is the Schema for the NotificationsConfiguration API
    28  // +k8s:openapi-gen=true
    29  // +kubebuilder:subresource:status
    30  // +operator-sdk:csv:customresourcedefinitions:resources={{NotificationsConfiguration,v1beta1,""}}
    31  // +operator-sdk:csv:customresourcedefinitions:resources={{ConfigMap,v1,""}}
    32  type NotificationsConfiguration struct {
    33  	metav1.TypeMeta   `json:",inline"`
    34  	metav1.ObjectMeta `json:"metadata,omitempty"`
    35  
    36  	Spec NotificationsConfigurationSpec `json:"spec,omitempty"`
    37  }
    38  
    39  //+kubebuilder:object:root=true
    40  
    41  // NotificationsConfigurationList contains a list of NotificationsConfiguration
    42  type NotificationsConfigurationList struct {
    43  	metav1.TypeMeta `json:",inline"`
    44  	metav1.ListMeta `json:"metadata,omitempty"`
    45  	Items           []NotificationsConfiguration `json:"items"`
    46  }
    47  
    48  // NotificationsConfigurationSpec allows users to define the triggers, templates, services, context and
    49  // subscriptions for the notifications
    50  type NotificationsConfigurationSpec struct {
    51  	// Triggers define the condition when the notification should be sent and list of templates required to generate the message
    52  	// Recipients can subscribe to the trigger and specify the required message template and destination notification service.
    53  	Triggers map[string]string `json:"triggers,omitempty"`
    54  	// Templates are used to generate the notification template message
    55  	Templates map[string]string `json:"templates,omitempty"`
    56  	// Services are used to deliver message
    57  	Services map[string]string `json:"services,omitempty"`
    58  	// Subscriptions contain centrally managed global application subscriptions
    59  	Subscriptions map[string]string `json:"subscriptions,omitempty"`
    60  }