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

com.azure.resourcemanager.automation.implementation.JobStreamsImpl 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.automation.implementation;

import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.automation.fluent.JobStreamsClient;
import com.azure.resourcemanager.automation.fluent.models.JobStreamInner;
import com.azure.resourcemanager.automation.models.JobStream;
import com.azure.resourcemanager.automation.models.JobStreams;

public final class JobStreamsImpl implements JobStreams {
    private static final ClientLogger LOGGER = new ClientLogger(JobStreamsImpl.class);

    private final JobStreamsClient innerClient;

    private final com.azure.resourcemanager.automation.AutomationManager serviceManager;

    public JobStreamsImpl(JobStreamsClient innerClient,
        com.azure.resourcemanager.automation.AutomationManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public Response getWithResponse(String resourceGroupName, String automationAccountName, String jobName,
        String jobStreamId, String clientRequestId, Context context) {
        Response inner = this.serviceClient()
            .getWithResponse(resourceGroupName, automationAccountName, jobName, jobStreamId, clientRequestId, context);
        if (inner != null) {
            return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
                new JobStreamImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public JobStream get(String resourceGroupName, String automationAccountName, String jobName, String jobStreamId) {
        JobStreamInner inner = this.serviceClient().get(resourceGroupName, automationAccountName, jobName, jobStreamId);
        if (inner != null) {
            return new JobStreamImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    public PagedIterable listByJob(String resourceGroupName, String automationAccountName, String jobName) {
        PagedIterable inner
            = this.serviceClient().listByJob(resourceGroupName, automationAccountName, jobName);
        return ResourceManagerUtils.mapPage(inner, inner1 -> new JobStreamImpl(inner1, this.manager()));
    }

    public PagedIterable listByJob(String resourceGroupName, String automationAccountName, String jobName,
        String filter, String clientRequestId, Context context) {
        PagedIterable inner = this.serviceClient()
            .listByJob(resourceGroupName, automationAccountName, jobName, filter, clientRequestId, context);
        return ResourceManagerUtils.mapPage(inner, inner1 -> new JobStreamImpl(inner1, this.manager()));
    }

    private JobStreamsClient serviceClient() {
        return this.innerClient;
    }

    private com.azure.resourcemanager.automation.AutomationManager manager() {
        return this.serviceManager;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy