# GeneratedOperation

# GeneratedOperation


```
interface GeneratedOperation<Connector : GeneratedConnector<Connector>, Data : Any?, Variables : Any?>
```

<br />

Known direct subclasses [GeneratedMutation](https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedMutation), [GeneratedQuery](https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedQuery)

|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedMutation` | The specialization of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation` for mutations. |
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedQuery` | The specialization of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation` for queries. |

*** ** * ** ***

The parent of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedQuery` and `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedMutation`, which are to be implemented by per-query and per-mutation classes, respectively, generated by the Firebase CLI code generation.

### Safe for concurrent use

All methods and properties of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation` are thread-safe and may be safely called and/or accessed concurrently from multiple threads and/or coroutines.

### Stable for inheritance

The `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation` interface *is* stable for inheritance in third-party libraries, as new methods will not be added to this interface and contracts of the existing methods will not be changed, except possibly during major version number changes.

## Summary

| ### Public functions |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation<Connector, Data, Variables>` | `@https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/ExperimentalFirebaseDataConnect https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#copy(com.google.firebase.dataconnect.generated.GeneratedConnector,kotlin.String,kotlinx.serialization.DeserializationStrategy,kotlinx.serialization.SerializationStrategy)( connector: Connector, operationName: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, dataDeserializer: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-deserialization-strategy/index.html<Data>, variablesSerializer: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-serialization-strategy/index.html<Variables> )` Creates and returns a new object that is a *copy* of this object, but with the properties whose names corresponding to the given arguments changed to the respective argument's value. |
| `operator https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#equals(kotlin.Any)(other: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?)` Compares this object with another object for equality. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#hashCode()()` Calculates and returns the hash code for this object. |
| `open https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/OperationRef<Data, Variables>` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#ref(kotlin.Any)(variables: Variables)` Returns a `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/OperationRef` that can be used to execute this operation with the given variables. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#toString()()` Returns a string representation of this object, useful for debugging. |
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation<Connector, NewData, Variables>` | `@https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/ExperimentalFirebaseDataConnect <NewData : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?> https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#withDataDeserializer(kotlinx.serialization.DeserializationStrategy)( dataDeserializer: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-deserialization-strategy/index.html<NewData> )` Creates and returns a new object that is a *copy* of this object, just like `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#copy(com.google.firebase.dataconnect.generated.GeneratedConnector,kotlin.String,kotlinx.serialization.DeserializationStrategy,kotlinx.serialization.SerializationStrategy)`, except that the `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#withDataDeserializer(kotlinx.serialization.DeserializationStrategy)` can be a different type than `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation`. |
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation<Connector, Data, NewVariables>` | `@https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/ExperimentalFirebaseDataConnect <NewVariables : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?> https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#withVariablesSerializer(kotlinx.serialization.SerializationStrategy)( variablesSerializer: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-serialization-strategy/index.html<NewVariables> )` Creates and returns a new object that is a *copy* of this object, just like `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#copy(com.google.firebase.dataconnect.generated.GeneratedConnector,kotlin.String,kotlinx.serialization.DeserializationStrategy,kotlinx.serialization.SerializationStrategy)`, except that the `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#withVariablesSerializer(kotlinx.serialization.SerializationStrategy)` can be a different type than `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation`. |

| ### Public properties |
|---|---|
| `Connector` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#connector()` The `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedConnector` with which this object is associated. |
| `https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-deserialization-strategy/index.html<Data>` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#dataDeserializer()` The deserializer to use to deserialize the response data for this operation. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#operationName()` The name of the operation, as defined in GraphQL. |
| `https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-serialization-strategy/index.html<Variables>` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#variablesSerializer()` The serializer to use to serialize the variables for this operation. |

## Public functions

### copy

```
@ExperimentalFirebaseDataConnect
fun copy(
    connector: Connector = this.connector,
    operationName: String = this.operationName,
    dataDeserializer: DeserializationStrategy<Data> = this.dataDeserializer,
    variablesSerializer: SerializationStrategy<Variables> = this.variablesSerializer
): GeneratedOperation<Connector, Data, Variables>
```

Creates and returns a new object that is a *copy* of this object, but with the properties whose names corresponding to the given arguments changed to the respective argument's value.

This function is essentially the same as the `copy()` method that is generated by the Kotlin compiler for `data class` classes.

| See also |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#withDataDeserializer(kotlinx.serialization.DeserializationStrategy)` |   |
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#withVariablesSerializer(kotlinx.serialization.SerializationStrategy)` |   |

### equals

```
operator fun equals(other: Any?): Boolean
```

Compares this object with another object for equality.

If this methods returns `true` then invoking any method or accessing any property on `this` should have the same side effects as accessing the same property or invoking the same method with the same arguments on `other`, respectively. The implementation checks for *logical* equality, rather than *referential* equality. A likely implementation looks like this:

```kotlin
override fun equals(other: Any?): Boolean =
  other is DemoConnectorGeneratedQueryImpl<*,*> &&
  other.connector == connector &&
  other.operationName == operationName &&
  other.dataDeserializer == dataDeserializer &&
  other.variablesSerializer == variablesSerializer
```

| Parameters |
|---|---|
| `other: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?` | The object to compare to this for equality. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `true` if, and only if, the given object is logically "equal" to this object. |

### hashCode

```
fun hashCode(): Int
```

Calculates and returns the hash code for this object.

| Returns |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | the hash code for this object. |

### ref

```
open fun ref(variables: Variables): OperationRef<Data, Variables>
```

Returns a `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/OperationRef` that can be used to execute this operation with the given variables.

### toString

```
fun toString(): String
```

Returns a string representation of this object, useful for debugging.

The string representation is *not* guaranteed to be stable and may change without notice at any time. Therefore, the only recommended usage of the returned string is debugging and/or logging. Namely, parsing the returned string or storing the returned string in non-volatile storage should generally be avoided in order to be robust in case that the string representation changes.

| Returns |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | a string representation of this object, which includes the class name and the values of all public properties. |

### withDataDeserializer

```
@ExperimentalFirebaseDataConnect
fun <NewData : Any?> withDataDeserializer(
    dataDeserializer: DeserializationStrategy<NewData>
): GeneratedOperation<Connector, NewData, Variables>
```

Creates and returns a new object that is a *copy* of this object, just like `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#copy(com.google.firebase.dataconnect.generated.GeneratedConnector,kotlin.String,kotlinx.serialization.DeserializationStrategy,kotlinx.serialization.SerializationStrategy)`, except that the `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#withDataDeserializer(kotlinx.serialization.DeserializationStrategy)` can be a different type than `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation`.

| See also |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#copy(com.google.firebase.dataconnect.generated.GeneratedConnector,kotlin.String,kotlinx.serialization.DeserializationStrategy,kotlinx.serialization.SerializationStrategy)` |   |
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#withVariablesSerializer(kotlinx.serialization.SerializationStrategy)` |   |

### withVariablesSerializer

```
@ExperimentalFirebaseDataConnect
fun <NewVariables : Any?> withVariablesSerializer(
    variablesSerializer: SerializationStrategy<NewVariables>
): GeneratedOperation<Connector, Data, NewVariables>
```

Creates and returns a new object that is a *copy* of this object, just like `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#copy(com.google.firebase.dataconnect.generated.GeneratedConnector,kotlin.String,kotlinx.serialization.DeserializationStrategy,kotlinx.serialization.SerializationStrategy)`, except that the `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#withVariablesSerializer(kotlinx.serialization.SerializationStrategy)` can be a different type than `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation`.

| See also |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#copy(com.google.firebase.dataconnect.generated.GeneratedConnector,kotlin.String,kotlinx.serialization.DeserializationStrategy,kotlinx.serialization.SerializationStrategy)` |   |
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedOperation#withDataDeserializer(kotlinx.serialization.DeserializationStrategy)` |   |

## Public properties

### connector

```
val connector: Connector
```

The `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/generated/GeneratedConnector` with which this object is associated.

### dataDeserializer

```
val dataDeserializer: DeserializationStrategy<Data>
```

The deserializer to use to deserialize the response data for this operation.

| See also |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/OperationRef#dataDeserializer()` |   |

### operationName

```
val operationName: String
```

The name of the operation, as defined in GraphQL.

| See also |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/OperationRef#operationName()` |   |

### variablesSerializer

```
val variablesSerializer: SerializationStrategy<Variables>
```

The serializer to use to serialize the variables for this operation.

| See also |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/OperationRef#variablesSerializer()` |   |