com.google.api.HttpBodyKt.kt Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/httpbody.proto
// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package com.google.api;
@kotlin.jvm.JvmName("-initializehttpBody")
public inline fun httpBody(block: com.google.api.HttpBodyKt.Dsl.() -> kotlin.Unit): com.google.api.HttpBody =
com.google.api.HttpBodyKt.Dsl._create(com.google.api.HttpBody.newBuilder()).apply { block() }._build()
/**
* ```
* Message that represents an arbitrary HTTP body. It should only be used for
* payload formats that can't be represented as JSON, such as raw binary or
* an HTML page.
*
*
* This message can be used both in streaming and non-streaming API methods in
* the request as well as the response.
*
* It can be used as a top-level request field, which is convenient if one
* wants to extract parameters from either the URL or HTTP template into the
* request fields and also want access to the raw HTTP body.
*
* Example:
*
* message GetResourceRequest {
* // A unique request id.
* string request_id = 1;
*
* // The raw HTTP body is bound to this field.
* google.api.HttpBody http_body = 2;
* }
*
* service ResourceService {
* rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
* rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty);
* }
*
* Example with streaming methods:
*
* service CaldavService {
* rpc GetCalendar(stream google.api.HttpBody)
* returns (stream google.api.HttpBody);
* rpc UpdateCalendar(stream google.api.HttpBody)
* returns (stream google.api.HttpBody);
* }
*
* Use of this type only changes how the request and response bodies are
* handled, all other features will continue to work unchanged.
* ```
*
* Protobuf type `google.api.HttpBody`
*/
public object HttpBodyKt {
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
@com.google.protobuf.kotlin.ProtoDslMarker
public class Dsl private constructor(
private val _builder: com.google.api.HttpBody.Builder
) {
public companion object {
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _create(builder: com.google.api.HttpBody.Builder): Dsl = Dsl(builder)
}
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _build(): com.google.api.HttpBody = _builder.build()
/**
* ```
* The HTTP Content-Type string representing the content type of the body.
* ```
*
* `string content_type = 1;`
*/
public var contentType: kotlin.String
@JvmName("getContentType")
get() = _builder.getContentType()
@JvmName("setContentType")
set(value) {
_builder.setContentType(value)
}
/**
* ```
* The HTTP Content-Type string representing the content type of the body.
* ```
*
* `string content_type = 1;`
*/
public fun clearContentType() {
_builder.clearContentType()
}
/**
* ```
* HTTP body binary data.
* ```
*
* `bytes data = 2;`
*/
public var data: com.google.protobuf.ByteString
@JvmName("getData")
get() = _builder.getData()
@JvmName("setData")
set(value) {
_builder.setData(value)
}
/**
* ```
* HTTP body binary data.
* ```
*
* `bytes data = 2;`
*/
public fun clearData() {
_builder.clearData()
}
/**
* An uninstantiable, behaviorless type to represent the field in
* generics.
*/
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
public class ExtensionsProxy private constructor() : com.google.protobuf.kotlin.DslProxy()
/**
* ```
* Application specific response metadata. Must be set in the first response
* for streaming APIs.
* ```
*
* `repeated .google.protobuf.Any extensions = 3;`
*/
public val extensions: com.google.protobuf.kotlin.DslList
@kotlin.jvm.JvmSynthetic
get() = com.google.protobuf.kotlin.DslList(
_builder.getExtensionsList()
)
/**
* ```
* Application specific response metadata. Must be set in the first response
* for streaming APIs.
* ```
*
* `repeated .google.protobuf.Any extensions = 3;`
* @param value The extensions to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("addExtensions")
public fun com.google.protobuf.kotlin.DslList.add(value: com.google.protobuf.Any) {
_builder.addExtensions(value)
}
/**
* ```
* Application specific response metadata. Must be set in the first response
* for streaming APIs.
* ```
*
* `repeated .google.protobuf.Any extensions = 3;`
* @param value The extensions to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("plusAssignExtensions")
@Suppress("NOTHING_TO_INLINE")
public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: com.google.protobuf.Any) {
add(value)
}
/**
* ```
* Application specific response metadata. Must be set in the first response
* for streaming APIs.
* ```
*
* `repeated .google.protobuf.Any extensions = 3;`
* @param values The extensions to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("addAllExtensions")
public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) {
_builder.addAllExtensions(values)
}
/**
* ```
* Application specific response metadata. Must be set in the first response
* for streaming APIs.
* ```
*
* `repeated .google.protobuf.Any extensions = 3;`
* @param values The extensions to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("plusAssignAllExtensions")
@Suppress("NOTHING_TO_INLINE")
public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) {
addAll(values)
}
/**
* ```
* Application specific response metadata. Must be set in the first response
* for streaming APIs.
* ```
*
* `repeated .google.protobuf.Any extensions = 3;`
* @param index The index to set the value at.
* @param value The extensions to set.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("setExtensions")
public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: com.google.protobuf.Any) {
_builder.setExtensions(index, value)
}
/**
* ```
* Application specific response metadata. Must be set in the first response
* for streaming APIs.
* ```
*
* `repeated .google.protobuf.Any extensions = 3;`
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("clearExtensions")
public fun com.google.protobuf.kotlin.DslList.clear() {
_builder.clearExtensions()
}
}
}
@kotlin.jvm.JvmSynthetic
public inline fun com.google.api.HttpBody.copy(block: `com.google.api`.HttpBodyKt.Dsl.() -> kotlin.Unit): com.google.api.HttpBody =
`com.google.api`.HttpBodyKt.Dsl._create(this.toBuilder()).apply { block() }._build()