// Code generated by sidekick. DO NOT EDIT.
//
// Copyright 2026 Google LLC
//
// 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
//
//     https://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.

import Foundation
import GoogleCloudGax
import GoogleCloudWkt

/// The response message for
/// [AssetService.AnalyzeOrgPolicyGovernedContainers][google.cloud.asset.v1.AssetService.AnalyzeOrgPolicyGovernedContainers].
///
/// [google.cloud.asset.v1.AssetService.AnalyzeOrgPolicyGovernedContainers]: <doc:AssetService/analyzeOrgPolicyGovernedContainers(request:)>
public struct AnalyzeOrgPolicyGovernedContainersResponse: Codable, Equatable, GoogleCloudWkt
    ._AnyPackable,
  GoogleCloudGax._PaginatedResponse,
  Sendable
{
  /// The list of the analyzed governed containers.
  public var governedContainers: [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer] = []

  /// The definition of the constraint in the request.
  public var constraint: AnalyzerOrgPolicyConstraint? = nil

  /// The page token to fetch the next page for
  /// [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers].
  ///
  /// [google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers]: <doc:AnalyzeOrgPolicyGovernedContainersResponse/governedContainers>
  public var nextPageToken: Swift.String = Swift.String()

  /// Initialize a new instance of `AnalyzeOrgPolicyGovernedContainersResponse`.
  public init() {}

  /// Use `config` to return a new instance of this object, with some fields updated.
  ///
  /// Commonly used to initialize the value, for example:
  ///
  /// ```
  /// let value = AnalyzeOrgPolicyGovernedContainersResponse().with { $0.governedContainers = ... }
  /// ```
  public func with(_ config: (inout Self) throws -> Swift.Void) rethrows -> Self {
    var copy = self
    try config(&copy)
    return copy
  }

  /// The organization/folder/project resource governed by organization policies
  /// of
  /// [AnalyzeOrgPolicyGovernedContainersRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest.constraint].
  ///
  /// [google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest.constraint]: <doc:AnalyzeOrgPolicyGovernedContainersRequest/constraint>
  public struct GovernedContainer: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// The [full resource name]
    /// (https://cloud.google.com/asset-inventory/docs/resource-name-format) of
    /// an organization/folder/project resource.
    public var fullResourceName: Swift.String = Swift.String()

    /// The [full resource name]
    /// (https://cloud.google.com/asset-inventory/docs/resource-name-format) of
    /// the parent of
    /// [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.full_resource_name].
    ///
    /// [google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.full_resource_name]: <doc:AnalyzeOrgPolicyGovernedContainersResponse/GovernedContainer/fullResourceName>
    public var parent: Swift.String = Swift.String()

    /// The consolidated organization policy for the analyzed resource. The
    /// consolidated organization policy is computed by merging and evaluating
    /// [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policy_bundle][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policy_bundle].
    /// The evaluation will respect the organization policy [hierarchy
    /// rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy).
    ///
    /// [google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policy_bundle]: <doc:AnalyzeOrgPolicyGovernedContainersResponse/GovernedContainer/policyBundle>
    public var consolidatedPolicy: AnalyzerOrgPolicy? = nil

    /// The ordered list of all organization policies from the
    /// [consolidated_policy.attached_resource][google.cloud.asset.v1.AnalyzerOrgPolicy.attached_resource].
    /// to the scope specified in the request.
    ///
    /// If the constraint is defined with default policy, it will also appear in
    /// the list.
    ///
    /// [google.cloud.asset.v1.AnalyzerOrgPolicy.attached_resource]: <doc:AnalyzerOrgPolicy/attachedResource>
    public var policyBundle: [AnalyzerOrgPolicy] = []

    /// The project that this resource belongs to, in the format of
    /// projects/{PROJECT_NUMBER}. This field is available when the resource
    /// belongs to a project.
    public var project: Swift.String = Swift.String()

    /// The folder(s) that this resource belongs to, in the format of
    /// folders/{FOLDER_NUMBER}. This field is available when the resource
    /// belongs (directly or cascadingly) to one or more folders.
    public var folders: [Swift.String] = []

    /// The organization that this resource belongs to, in the format of
    /// organizations/{ORGANIZATION_NUMBER}. This field is available when the
    /// resource belongs (directly or cascadingly) to an organization.
    public var organization: Swift.String = Swift.String()

    /// The effective tags on this resource.
    public var effectiveTags: [EffectiveTagDetails] = []

    /// Initialize a new instance of `GovernedContainer`.
    public init() {}

    /// Use `config` to return a new instance of this object, with some fields updated.
    ///
    /// Commonly used to initialize the value, for example:
    ///
    /// ```
    /// let value = GovernedContainer().with { $0.fullResourceName = ... }
    /// ```
    public func with(_ config: (inout Self) throws -> Swift.Void) rethrows -> Self {
      var copy = self
      try config(&copy)
      return copy
    }

    public static var _anyTypeUrl: Swift.String {
      return
        "type.googleapis.com/google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer"
    }
    public init(fromAny any: GoogleCloudWkt.`Any`) throws {
      self = try GoogleCloudWkt._slowAnyDeserialize(Self.self, from: any)
    }
    public func _pack() throws -> GoogleCloudWkt.Struct {
      return try GoogleCloudWkt._slowAnySerialize(message: self)
    }
  }

  public static var _anyTypeUrl: Swift.String {
    return "type.googleapis.com/google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse"
  }
  public init(fromAny any: GoogleCloudWkt.`Any`) throws {
    self = try GoogleCloudWkt._slowAnyDeserialize(Self.self, from: any)
  }
  public func _pack() throws -> GoogleCloudWkt.Struct {
    return try GoogleCloudWkt._slowAnySerialize(message: self)
  }

  public func _getPaginatedItems() -> [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer]
  {
    return self.governedContainers
  }

  public func _nextPageToken() -> Swift.String {
    return self.nextPageToken
  }
}
