|
| 1 | +/* |
| 2 | + * Copyright 2025 Google LLC |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +// Auto-generated code. Do not edit. |
| 18 | + |
| 19 | +package com.google.genai.types; |
| 20 | + |
| 21 | +import com.fasterxml.jackson.annotation.JsonCreator; |
| 22 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 23 | +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
| 24 | +import com.google.auto.value.AutoValue; |
| 25 | +import com.google.errorprone.annotations.CanIgnoreReturnValue; |
| 26 | +import com.google.genai.JsonSerializable; |
| 27 | +import java.util.Optional; |
| 28 | + |
| 29 | +/** Proxy configuration for the client. */ |
| 30 | +@AutoValue |
| 31 | +@JsonDeserialize(builder = ProxyOptions.Builder.class) |
| 32 | +public abstract class ProxyOptions extends JsonSerializable { |
| 33 | + /** Proxy type. Defaults to HTTP if unspecified. */ |
| 34 | + @JsonProperty("type") |
| 35 | + public abstract Optional<ProxyType> type(); |
| 36 | + |
| 37 | + /** Proxy server hostname or IP address. */ |
| 38 | + @JsonProperty("host") |
| 39 | + public abstract Optional<String> host(); |
| 40 | + |
| 41 | + /** Proxy server port. */ |
| 42 | + @JsonProperty("port") |
| 43 | + public abstract Optional<Integer> port(); |
| 44 | + |
| 45 | + /** Username for proxy authentication. If provided, `password` must also be specified. */ |
| 46 | + @JsonProperty("username") |
| 47 | + public abstract Optional<String> username(); |
| 48 | + |
| 49 | + /** Password for proxy authentication. If provided, `username` must also be specified. */ |
| 50 | + @JsonProperty("password") |
| 51 | + public abstract Optional<String> password(); |
| 52 | + |
| 53 | + /** Instantiates a builder for ProxyOptions. */ |
| 54 | + @ExcludeFromGeneratedCoverageReport |
| 55 | + public static Builder builder() { |
| 56 | + return new AutoValue_ProxyOptions.Builder(); |
| 57 | + } |
| 58 | + |
| 59 | + /** Creates a builder with the same values as this instance. */ |
| 60 | + public abstract Builder toBuilder(); |
| 61 | + |
| 62 | + /** Builder for ProxyOptions. */ |
| 63 | + @AutoValue.Builder |
| 64 | + public abstract static class Builder { |
| 65 | + /** For internal usage. Please use `ProxyOptions.builder()` for instantiation. */ |
| 66 | + @JsonCreator |
| 67 | + private static Builder create() { |
| 68 | + return new AutoValue_ProxyOptions.Builder(); |
| 69 | + } |
| 70 | + |
| 71 | + /** |
| 72 | + * Setter for type. |
| 73 | + * |
| 74 | + * <p>type: Proxy type. Defaults to HTTP if unspecified. |
| 75 | + */ |
| 76 | + @JsonProperty("type") |
| 77 | + public abstract Builder type(ProxyType type); |
| 78 | + |
| 79 | + @ExcludeFromGeneratedCoverageReport |
| 80 | + abstract Builder type(Optional<ProxyType> type); |
| 81 | + |
| 82 | + /** Clears the value of type field. */ |
| 83 | + @ExcludeFromGeneratedCoverageReport |
| 84 | + @CanIgnoreReturnValue |
| 85 | + public Builder clearType() { |
| 86 | + return type(Optional.empty()); |
| 87 | + } |
| 88 | + |
| 89 | + /** |
| 90 | + * Setter for type given a known enum. |
| 91 | + * |
| 92 | + * <p>type: Proxy type. Defaults to HTTP if unspecified. |
| 93 | + */ |
| 94 | + @CanIgnoreReturnValue |
| 95 | + public Builder type(ProxyType.Known knownType) { |
| 96 | + return type(new ProxyType(knownType)); |
| 97 | + } |
| 98 | + |
| 99 | + /** |
| 100 | + * Setter for type given a string. |
| 101 | + * |
| 102 | + * <p>type: Proxy type. Defaults to HTTP if unspecified. |
| 103 | + */ |
| 104 | + @CanIgnoreReturnValue |
| 105 | + public Builder type(String type) { |
| 106 | + return type(new ProxyType(type)); |
| 107 | + } |
| 108 | + |
| 109 | + /** |
| 110 | + * Setter for host. |
| 111 | + * |
| 112 | + * <p>host: Proxy server hostname or IP address. |
| 113 | + */ |
| 114 | + @JsonProperty("host") |
| 115 | + public abstract Builder host(String host); |
| 116 | + |
| 117 | + @ExcludeFromGeneratedCoverageReport |
| 118 | + abstract Builder host(Optional<String> host); |
| 119 | + |
| 120 | + /** Clears the value of host field. */ |
| 121 | + @ExcludeFromGeneratedCoverageReport |
| 122 | + @CanIgnoreReturnValue |
| 123 | + public Builder clearHost() { |
| 124 | + return host(Optional.empty()); |
| 125 | + } |
| 126 | + |
| 127 | + /** |
| 128 | + * Setter for port. |
| 129 | + * |
| 130 | + * <p>port: Proxy server port. |
| 131 | + */ |
| 132 | + @JsonProperty("port") |
| 133 | + public abstract Builder port(Integer port); |
| 134 | + |
| 135 | + @ExcludeFromGeneratedCoverageReport |
| 136 | + abstract Builder port(Optional<Integer> port); |
| 137 | + |
| 138 | + /** Clears the value of port field. */ |
| 139 | + @ExcludeFromGeneratedCoverageReport |
| 140 | + @CanIgnoreReturnValue |
| 141 | + public Builder clearPort() { |
| 142 | + return port(Optional.empty()); |
| 143 | + } |
| 144 | + |
| 145 | + /** |
| 146 | + * Setter for username. |
| 147 | + * |
| 148 | + * <p>username: Username for proxy authentication. If provided, `password` must also be |
| 149 | + * specified. |
| 150 | + */ |
| 151 | + @JsonProperty("username") |
| 152 | + public abstract Builder username(String username); |
| 153 | + |
| 154 | + @ExcludeFromGeneratedCoverageReport |
| 155 | + abstract Builder username(Optional<String> username); |
| 156 | + |
| 157 | + /** Clears the value of username field. */ |
| 158 | + @ExcludeFromGeneratedCoverageReport |
| 159 | + @CanIgnoreReturnValue |
| 160 | + public Builder clearUsername() { |
| 161 | + return username(Optional.empty()); |
| 162 | + } |
| 163 | + |
| 164 | + /** |
| 165 | + * Setter for password. |
| 166 | + * |
| 167 | + * <p>password: Password for proxy authentication. If provided, `username` must also be |
| 168 | + * specified. |
| 169 | + */ |
| 170 | + @JsonProperty("password") |
| 171 | + public abstract Builder password(String password); |
| 172 | + |
| 173 | + @ExcludeFromGeneratedCoverageReport |
| 174 | + abstract Builder password(Optional<String> password); |
| 175 | + |
| 176 | + /** Clears the value of password field. */ |
| 177 | + @ExcludeFromGeneratedCoverageReport |
| 178 | + @CanIgnoreReturnValue |
| 179 | + public Builder clearPassword() { |
| 180 | + return password(Optional.empty()); |
| 181 | + } |
| 182 | + |
| 183 | + public abstract ProxyOptions build(); |
| 184 | + } |
| 185 | + |
| 186 | + /** Deserializes a JSON string to a ProxyOptions object. */ |
| 187 | + @ExcludeFromGeneratedCoverageReport |
| 188 | + public static ProxyOptions fromJson(String jsonString) { |
| 189 | + return JsonSerializable.fromJsonString(jsonString, ProxyOptions.class); |
| 190 | + } |
| 191 | +} |
0 commit comments