// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.resourcehealth.implementation;

import com.azure.core.http.rest.PagedIterable;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.resourcehealth.fluent.SecurityAdvisoryImpactedResourcesClient;
import com.azure.resourcemanager.resourcehealth.fluent.models.EventImpactedResourceInner;
import com.azure.resourcemanager.resourcehealth.models.EventImpactedResource;
import com.azure.resourcemanager.resourcehealth.models.SecurityAdvisoryImpactedResources;

public final class SecurityAdvisoryImpactedResourcesImpl implements SecurityAdvisoryImpactedResources {
    private static final ClientLogger LOGGER = new ClientLogger(SecurityAdvisoryImpactedResourcesImpl.class);

    private final SecurityAdvisoryImpactedResourcesClient innerClient;

    private final com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager;

    public SecurityAdvisoryImpactedResourcesImpl(
        SecurityAdvisoryImpactedResourcesClient innerClient,
        com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<EventImpactedResource> listBySubscriptionIdAndEventId(String eventTrackingId) {
        PagedIterable<EventImpactedResourceInner> inner =
            this.serviceClient().listBySubscriptionIdAndEventId(eventTrackingId);
        return Utils.mapPage(inner, inner1 -> new EventImpactedResourceImpl(inner1, this.manager()));
    }

    public PagedIterable<EventImpactedResource> listBySubscriptionIdAndEventId(
        String eventTrackingId, String filter, Context context) {
        PagedIterable<EventImpactedResourceInner> inner =
            this.serviceClient().listBySubscriptionIdAndEventId(eventTrackingId, filter, context);
        return Utils.mapPage(inner, inner1 -> new EventImpactedResourceImpl(inner1, this.manager()));
    }

    public PagedIterable<EventImpactedResource> listByTenantIdAndEventId(String eventTrackingId) {
        PagedIterable<EventImpactedResourceInner> inner =
            this.serviceClient().listByTenantIdAndEventId(eventTrackingId);
        return Utils.mapPage(inner, inner1 -> new EventImpactedResourceImpl(inner1, this.manager()));
    }

    public PagedIterable<EventImpactedResource> listByTenantIdAndEventId(
        String eventTrackingId, String filter, Context context) {
        PagedIterable<EventImpactedResourceInner> inner =
            this.serviceClient().listByTenantIdAndEventId(eventTrackingId, filter, context);
        return Utils.mapPage(inner, inner1 -> new EventImpactedResourceImpl(inner1, this.manager()));
    }

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

    private com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager() {
        return this.serviceManager;
    }
}
