// 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.

#if RegionNotificationEndpoints
  import Foundation
  import GoogleCloudWkt

  /// Represents a gRPC setting that describes one gRPC notification endpoint and
  /// the retry duration attempting to send notification to this endpoint.
  public struct NotificationEndpointGrpcSettings: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// Optional. If specified, this field is used to set the authority header by
    /// the sender of notifications. See
    /// https://tools.ietf.org/html/rfc7540#section-8.1.2.3
    public var authority: Swift.String? = nil

    /// Endpoint to which gRPC notifications are sent. This must be a valid
    /// gRPCLB DNS name.
    public var endpoint: Swift.String? = nil

    /// Optional. If specified, this field is used to populate the "name" field
    /// in gRPC requests.
    public var payloadName: Swift.String? = nil

    /// Optional. This field is used to configure how often to send a full update
    /// of all non-healthy backends. If unspecified, full updates are not sent.
    /// If specified, must be in the range between 600 seconds to 3600 seconds.
    /// Nanos are disallowed. Can only be set for regional notification
    /// endpoints.
    public var resendInterval: Duration? = nil

    /// How much time (in seconds) is spent attempting notification retries
    /// until a successful response is received. Default is 30s. Limit is 20m
    /// (1200s). Must be a positive number.
    public var retryDurationSec: Swift.UInt32? = nil

    /// Initialize a new instance of `NotificationEndpointGrpcSettings`.
    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 = NotificationEndpointGrpcSettings().with { $0.authority = ... }
    /// ```
    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.compute.v1.NotificationEndpointGrpcSettings"
    }
    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)
    }
  }
#endif
