/**
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */ import { KubernetesObject } from 'kpt-functions' ; import * as apisMetaV1 from './io.k8s.apimachinery.pkg.apis.meta.v1' ; export class MutatingWebhookConfiguration implements KubernetesObject { public apiVersion : string ; public kind : string ; public metadata : apisMetaV1 . ObjectMeta ; public webhooks ? : Webhook [ ] ; constructor ( desc ) { this . apiVersion = MutatingWebhookConfiguration . apiVersion ; this . kind = MutatingWebhookConfiguration . kind ; this . metadata = desc . metadata ; this . webhooks = desc . webhooks ; } } export function isMutatingWebhookConfiguration ( o ) { return ( o && o . apiVersion === MutatingWebhookConfiguration . apiVersion && o . kind === MutatingWebhookConfiguration . kind ) ; } export namespace MutatingWebhookConfiguration { export const apiVersion = 'admissionregistration.k8s.io/v1beta1' ; export const group = 'admissionregistration.k8s.io' ; export const version = 'v1beta1' ; export const kind = 'MutatingWebhookConfiguration' ; export function named ( name ) { return new MutatingWebhookConfiguration ( { metadata : { name } } ) ; } export interface Interface { metadata : apisMetaV1 . ObjectMeta ; webhooks ? : Webhook [ ] ; } } export class MutatingWebhookConfigurationList { public apiVersion : string ; public items : MutatingWebhookConfiguration [ ] ; public kind : string ; public metadata ? : apisMetaV1 . ListMeta ; constructor ( desc ) { this . apiVersion = MutatingWebhookConfigurationList . apiVersion ; this . items = desc . items . map ( ( i ) => new MutatingWebhookConfiguration ( i ) ) ; this . kind = MutatingWebhookConfigurationList . kind ; this . metadata = desc . metadata ; } } export function isMutatingWebhookConfigurationList ( o ) { return ( o && o . apiVersion === MutatingWebhookConfigurationList . apiVersion && o . kind === MutatingWebhookConfigurationList . kind ) ; } export namespace MutatingWebhookConfigurationList { export const apiVersion = 'admissionregistration.k8s.io/v1beta1' ; export const group = 'admissionregistration.k8s.io' ; export const version = 'v1beta1' ; export const kind = 'MutatingWebhookConfigurationList' ; export interface Interface { items : MutatingWebhookConfiguration [ ] ; metadata ? : apisMetaV1 . ListMeta ; } } export class RuleWithOperations { public apiGroups ? : string [ ] ; public apiVersions ? : string [ ] ; public operations ? : string [ ] ; public resources ? : string [ ] ; public scope ? : string ; } export class ServiceReference { public name : string ; public namespace : string ; public path ? : string ; constructor ( desc ) { this . name = desc . name ; this . namespace = desc . namespace ; this . path = desc . path ; } } export class ValidatingWebhookConfiguration implements KubernetesObject { public apiVersion : string ; public kind : string ; public metadata : apisMetaV1 . ObjectMeta ; public webhooks ? : Webhook [ ] ; constructor ( desc ) { this . apiVersion = ValidatingWebhookConfiguration . apiVersion ; this . kind = ValidatingWebhookConfiguration . kind ; this . metadata = desc . metadata ; this . webhooks = desc . webhooks ; } } export function isValidatingWebhookConfiguration ( o ) { return ( o && o . apiVersion === ValidatingWebhookConfiguration . apiVersion && o . kind === ValidatingWebhookConfiguration . kind ) ; } export namespace ValidatingWebhookConfiguration { export const apiVersion = 'admissionregistration.k8s.io/v1beta1' ; export const group = 'admissionregistration.k8s.io' ; export const version = 'v1beta1' ; export const kind = 'ValidatingWebhookConfiguration' ; export function named ( name ) { return new ValidatingWebhookConfiguration ( { metadata : { name } } ) ; } export interface Interface { metadata : apisMetaV1 . ObjectMeta ; webhooks ? : Webhook [ ] ; } } export class ValidatingWebhookConfigurationList { public apiVersion : string ; public items : ValidatingWebhookConfiguration [ ] ; public kind : string ; public metadata ? : apisMetaV1 . ListMeta ; constructor ( desc ) { this . apiVersion = ValidatingWebhookConfigurationList . apiVersion ; this . items = desc . items . map ( ( i ) => new ValidatingWebhookConfiguration ( i ) ) ; this . kind = ValidatingWebhookConfigurationList . kind ; this . metadata = desc . metadata ; } } export function isValidatingWebhookConfigurationList ( o ) { return ( o && o . apiVersion === ValidatingWebhookConfigurationList . apiVersion && o . kind === ValidatingWebhookConfigurationList . kind ) ; } export namespace ValidatingWebhookConfigurationList { export const apiVersion = 'admissionregistration.k8s.io/v1beta1' ; export const group = 'admissionregistration.k8s.io' ; export const version = 'v1beta1' ; export const kind = 'ValidatingWebhookConfigurationList' ; export interface Interface { items : ValidatingWebhookConfiguration [ ] ; metadata ? : apisMetaV1 . ListMeta ; } } export class Webhook { public admissionReviewVersions ? : string [ ] ; public clientConfig : WebhookClientConfig ; public failurePolicy ? : string ; public name : string ; public namespaceSelector ? : apisMetaV1 . LabelSelector ; public rules ? : RuleWithOperations [ ] ; public sideEffects ? : string ; public timeoutSeconds ? : number ; constructor ( desc ) { this . admissionReviewVersions = desc . admissionReviewVersions ; this . clientConfig = desc . clientConfig ; this . failurePolicy = desc . failurePolicy ; this . name = desc . name ; this . namespaceSelector = desc . namespaceSelector ; this . rules = desc . rules ; this . sideEffects = desc . sideEffects ; this . timeoutSeconds = desc . timeoutSeconds ; } } export class WebhookClientConfig { public caBundle ? : string ; public service ? : ServiceReference ; public url ? : string ; }