All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lumesnapshot-client.5.6.0.source-code.resource-handler.vm Maven / Gradle / Ivy

#*
 * Copyright (C) 2015 Red Hat, Inc.
 *
 * 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.
 *#

#set ($version = "unknown")
#set ($annotations = $model.annotations)
#foreach ($annotation in $annotations)
  #set ($annotationName = $annotation.getClassRef().getName())
  #if ($annotationName.endsWith("Version"))
    #set ($apiVersion = $annotation.getParameters().get("value"))
  #end
  #if ($annotationName.endsWith("Group"))
    #set ($apiGroup = $annotation.getParameters().get("value"))
  #end
#end


package io.fabric8.volumesnapshot.client.handlers;

import io.fabric8.kubernetes.client.Config;
import io.fabric8.kubernetes.client.ResourceHandler;
import io.fabric8.volumesnapshot.client.internal.${model.name}OperationsImpl;
import io.fabric8.kubernetes.client.dsl.Resource;
import okhttp3.OkHttpClient;

import ${model.fullyQualifiedName};
import ${model.fullyQualifiedName}Builder;

public class ${model.name}Handler implements ResourceHandler<${model.name}, ${model.name}Builder> {

  @Override
  public String getKind() {
    return ${model.name}.class.getSimpleName();
  }

  @Override
  public String getApiVersion() {
    #if (${apiGroup} != "")
    return "${apiGroup}/${apiVersion}";
    #else
    return "${apiVersion}";
    #end
  }

  @Override
  public ${model.name}Builder edit(${model.name} item) {
    return new ${model.name}Builder(item);
  }

  @Override
  public Resource<${model.name}> resource(OkHttpClient client, Config config, String namespace, ${model.name} item) {
    return new ${model.name}OperationsImpl(client, config).withItem(item).inNamespace(namespace).withName(item.getMetadata().getName());
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy