com.azure.resourcemanager.mediaservices.fluent.models.JobInner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-mediaservices Show documentation
Show all versions of azure-resourcemanager-mediaservices Show documentation
This package contains Microsoft Azure SDK for MediaServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. This Swagger was generated by the API Framework. Package tag package-account-2023-01.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mediaservices.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.mediaservices.models.JobInput;
import com.azure.resourcemanager.mediaservices.models.JobOutput;
import com.azure.resourcemanager.mediaservices.models.JobState;
import com.azure.resourcemanager.mediaservices.models.Priority;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;
/**
* A Job resource type. The progress and state can be obtained by polling a Job or subscribing to events using
* EventGrid.
*/
@Fluent
public final class JobInner extends ProxyResource {
/*
* The resource properties.
*/
private JobProperties innerProperties;
/*
* The system metadata relating to this resource.
*/
private SystemData systemData;
/*
* The type of the resource.
*/
private String type;
/*
* The name of the resource.
*/
private String name;
/*
* Fully qualified resource Id for the resource.
*/
private String id;
/**
* Creates an instance of JobInner class.
*/
public JobInner() {
}
/**
* Get the innerProperties property: The resource properties.
*
* @return the innerProperties value.
*/
private JobProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the systemData property: The system metadata relating to this resource.
*
* @return the systemData value.
*/
public SystemData systemData() {
return this.systemData;
}
/**
* Get the type property: The type of the resource.
*
* @return the type value.
*/
@Override
public String type() {
return this.type;
}
/**
* Get the name property: The name of the resource.
*
* @return the name value.
*/
@Override
public String name() {
return this.name;
}
/**
* Get the id property: Fully qualified resource Id for the resource.
*
* @return the id value.
*/
@Override
public String id() {
return this.id;
}
/**
* Get the created property: The UTC date and time when the customer has created the Job, in 'YYYY-MM-DDThh:mm:ssZ'
* format.
*
* @return the created value.
*/
public OffsetDateTime created() {
return this.innerProperties() == null ? null : this.innerProperties().created();
}
/**
* Get the state property: The current state of the job.
*
* @return the state value.
*/
public JobState state() {
return this.innerProperties() == null ? null : this.innerProperties().state();
}
/**
* Get the description property: Optional customer supplied description of the Job.
*
* @return the description value.
*/
public String description() {
return this.innerProperties() == null ? null : this.innerProperties().description();
}
/**
* Set the description property: Optional customer supplied description of the Job.
*
* @param description the description value to set.
* @return the JobInner object itself.
*/
public JobInner withDescription(String description) {
if (this.innerProperties() == null) {
this.innerProperties = new JobProperties();
}
this.innerProperties().withDescription(description);
return this;
}
/**
* Get the input property: The inputs for the Job.
*
* @return the input value.
*/
public JobInput input() {
return this.innerProperties() == null ? null : this.innerProperties().input();
}
/**
* Set the input property: The inputs for the Job.
*
* @param input the input value to set.
* @return the JobInner object itself.
*/
public JobInner withInput(JobInput input) {
if (this.innerProperties() == null) {
this.innerProperties = new JobProperties();
}
this.innerProperties().withInput(input);
return this;
}
/**
* Get the lastModified property: The UTC date and time when the customer has last updated the Job, in
* 'YYYY-MM-DDThh:mm:ssZ' format.
*
* @return the lastModified value.
*/
public OffsetDateTime lastModified() {
return this.innerProperties() == null ? null : this.innerProperties().lastModified();
}
/**
* Get the outputs property: The outputs for the Job.
*
* @return the outputs value.
*/
public List outputs() {
return this.innerProperties() == null ? null : this.innerProperties().outputs();
}
/**
* Set the outputs property: The outputs for the Job.
*
* @param outputs the outputs value to set.
* @return the JobInner object itself.
*/
public JobInner withOutputs(List outputs) {
if (this.innerProperties() == null) {
this.innerProperties = new JobProperties();
}
this.innerProperties().withOutputs(outputs);
return this;
}
/**
* Get the priority property: Priority with which the job should be processed. Higher priority jobs are processed
* before lower priority jobs. If not set, the default is normal.
*
* @return the priority value.
*/
public Priority priority() {
return this.innerProperties() == null ? null : this.innerProperties().priority();
}
/**
* Set the priority property: Priority with which the job should be processed. Higher priority jobs are processed
* before lower priority jobs. If not set, the default is normal.
*
* @param priority the priority value to set.
* @return the JobInner object itself.
*/
public JobInner withPriority(Priority priority) {
if (this.innerProperties() == null) {
this.innerProperties = new JobProperties();
}
this.innerProperties().withPriority(priority);
return this;
}
/**
* Get the correlationData property: Customer provided key, value pairs that will be returned in Job and JobOutput
* state events.
*
* @return the correlationData value.
*/
public Map correlationData() {
return this.innerProperties() == null ? null : this.innerProperties().correlationData();
}
/**
* Set the correlationData property: Customer provided key, value pairs that will be returned in Job and JobOutput
* state events.
*
* @param correlationData the correlationData value to set.
* @return the JobInner object itself.
*/
public JobInner withCorrelationData(Map correlationData) {
if (this.innerProperties() == null) {
this.innerProperties = new JobProperties();
}
this.innerProperties().withCorrelationData(correlationData);
return this;
}
/**
* Get the startTime property: The UTC date and time at which this Job began processing.
*
* @return the startTime value.
*/
public OffsetDateTime startTime() {
return this.innerProperties() == null ? null : this.innerProperties().startTime();
}
/**
* Get the endTime property: The UTC date and time at which this Job finished processing.
*
* @return the endTime value.
*/
public OffsetDateTime endTime() {
return this.innerProperties() == null ? null : this.innerProperties().endTime();
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerProperties() != null) {
innerProperties().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("properties", this.innerProperties);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of JobInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of JobInner if the JsonReader was pointing to an instance of it, or null if it was pointing
* to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the JobInner.
*/
public static JobInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
JobInner deserializedJobInner = new JobInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedJobInner.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedJobInner.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedJobInner.type = reader.getString();
} else if ("properties".equals(fieldName)) {
deserializedJobInner.innerProperties = JobProperties.fromJson(reader);
} else if ("systemData".equals(fieldName)) {
deserializedJobInner.systemData = SystemData.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedJobInner;
});
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy