Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.azure.resourcemanager.datafactory.implementation.PipelineResourceImpl Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.datafactory.implementation;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
import com.azure.resourcemanager.datafactory.fluent.models.PipelineResourceInner;
import com.azure.resourcemanager.datafactory.models.Activity;
import com.azure.resourcemanager.datafactory.models.CreateRunResponse;
import com.azure.resourcemanager.datafactory.models.ParameterSpecification;
import com.azure.resourcemanager.datafactory.models.PipelineFolder;
import com.azure.resourcemanager.datafactory.models.PipelinePolicy;
import com.azure.resourcemanager.datafactory.models.PipelineResource;
import com.azure.resourcemanager.datafactory.models.VariableSpecification;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public final class PipelineResourceImpl
implements PipelineResource, PipelineResource.Definition, PipelineResource.Update {
private PipelineResourceInner innerObject;
private final com.azure.resourcemanager.datafactory.DataFactoryManager serviceManager;
public String id() {
return this.innerModel().id();
}
public String name() {
return this.innerModel().name();
}
public String type() {
return this.innerModel().type();
}
public String etag() {
return this.innerModel().etag();
}
public Map additionalProperties() {
Map inner = this.innerModel().additionalProperties();
if (inner != null) {
return Collections.unmodifiableMap(inner);
} else {
return Collections.emptyMap();
}
}
public String description() {
return this.innerModel().description();
}
public List activities() {
List inner = this.innerModel().activities();
if (inner != null) {
return Collections.unmodifiableList(inner);
} else {
return Collections.emptyList();
}
}
public Map parameters() {
Map inner = this.innerModel().parameters();
if (inner != null) {
return Collections.unmodifiableMap(inner);
} else {
return Collections.emptyMap();
}
}
public Map variables() {
Map inner = this.innerModel().variables();
if (inner != null) {
return Collections.unmodifiableMap(inner);
} else {
return Collections.emptyMap();
}
}
public Integer concurrency() {
return this.innerModel().concurrency();
}
public List annotations() {
List inner = this.innerModel().annotations();
if (inner != null) {
return Collections.unmodifiableList(inner);
} else {
return Collections.emptyList();
}
}
public Map runDimensions() {
Map inner = this.innerModel().runDimensions();
if (inner != null) {
return Collections.unmodifiableMap(inner);
} else {
return Collections.emptyMap();
}
}
public PipelineFolder folder() {
return this.innerModel().folder();
}
public PipelinePolicy policy() {
return this.innerModel().policy();
}
public String resourceGroupName() {
return resourceGroupName;
}
public PipelineResourceInner innerModel() {
return this.innerObject;
}
private com.azure.resourcemanager.datafactory.DataFactoryManager manager() {
return this.serviceManager;
}
private String resourceGroupName;
private String factoryName;
private String pipelineName;
private String createIfMatch;
private String updateIfMatch;
public PipelineResourceImpl withExistingFactory(String resourceGroupName, String factoryName) {
this.resourceGroupName = resourceGroupName;
this.factoryName = factoryName;
return this;
}
public PipelineResource create() {
this.innerObject = serviceManager.serviceClient()
.getPipelines()
.createOrUpdateWithResponse(resourceGroupName, factoryName, pipelineName, this.innerModel(), createIfMatch,
Context.NONE)
.getValue();
return this;
}
public PipelineResource create(Context context) {
this.innerObject = serviceManager.serviceClient()
.getPipelines()
.createOrUpdateWithResponse(resourceGroupName, factoryName, pipelineName, this.innerModel(), createIfMatch,
context)
.getValue();
return this;
}
PipelineResourceImpl(String name, com.azure.resourcemanager.datafactory.DataFactoryManager serviceManager) {
this.innerObject = new PipelineResourceInner();
this.serviceManager = serviceManager;
this.pipelineName = name;
this.createIfMatch = null;
}
public PipelineResourceImpl update() {
this.updateIfMatch = null;
return this;
}
public PipelineResource apply() {
this.innerObject = serviceManager.serviceClient()
.getPipelines()
.createOrUpdateWithResponse(resourceGroupName, factoryName, pipelineName, this.innerModel(), updateIfMatch,
Context.NONE)
.getValue();
return this;
}
public PipelineResource apply(Context context) {
this.innerObject = serviceManager.serviceClient()
.getPipelines()
.createOrUpdateWithResponse(resourceGroupName, factoryName, pipelineName, this.innerModel(), updateIfMatch,
context)
.getValue();
return this;
}
PipelineResourceImpl(PipelineResourceInner innerObject,
com.azure.resourcemanager.datafactory.DataFactoryManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
this.factoryName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "factories");
this.pipelineName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "pipelines");
}
public PipelineResource refresh() {
String localIfNoneMatch = null;
this.innerObject = serviceManager.serviceClient()
.getPipelines()
.getWithResponse(resourceGroupName, factoryName, pipelineName, localIfNoneMatch, Context.NONE)
.getValue();
return this;
}
public PipelineResource refresh(Context context) {
String localIfNoneMatch = null;
this.innerObject = serviceManager.serviceClient()
.getPipelines()
.getWithResponse(resourceGroupName, factoryName, pipelineName, localIfNoneMatch, context)
.getValue();
return this;
}
public Response createRunWithResponse(String referencePipelineRunId, Boolean isRecovery,
String startActivityName, Boolean startFromFailure, Map parameters, Context context) {
return serviceManager.pipelines()
.createRunWithResponse(resourceGroupName, factoryName, pipelineName, referencePipelineRunId, isRecovery,
startActivityName, startFromFailure, parameters, context);
}
public CreateRunResponse createRun() {
return serviceManager.pipelines().createRun(resourceGroupName, factoryName, pipelineName);
}
public PipelineResourceImpl withAdditionalProperties(Map additionalProperties) {
this.innerModel().withAdditionalProperties(additionalProperties);
return this;
}
public PipelineResourceImpl withDescription(String description) {
this.innerModel().withDescription(description);
return this;
}
public PipelineResourceImpl withActivities(List activities) {
this.innerModel().withActivities(activities);
return this;
}
public PipelineResourceImpl withParameters(Map parameters) {
this.innerModel().withParameters(parameters);
return this;
}
public PipelineResourceImpl withVariables(Map variables) {
this.innerModel().withVariables(variables);
return this;
}
public PipelineResourceImpl withConcurrency(Integer concurrency) {
this.innerModel().withConcurrency(concurrency);
return this;
}
public PipelineResourceImpl withAnnotations(List annotations) {
this.innerModel().withAnnotations(annotations);
return this;
}
public PipelineResourceImpl withRunDimensions(Map runDimensions) {
this.innerModel().withRunDimensions(runDimensions);
return this;
}
public PipelineResourceImpl withFolder(PipelineFolder folder) {
this.innerModel().withFolder(folder);
return this;
}
public PipelineResourceImpl withPolicy(PipelinePolicy policy) {
this.innerModel().withPolicy(policy);
return this;
}
public PipelineResourceImpl withIfMatch(String ifMatch) {
if (isInCreateMode()) {
this.createIfMatch = ifMatch;
return this;
} else {
this.updateIfMatch = ifMatch;
return this;
}
}
private boolean isInCreateMode() {
return this.innerModel().id() == null;
}
}