Skip to content

Commit d036552

Browse files
committed
DataConnectPathSegment.kt created, which is DataConnectOperationFailureResponse.ErrorInfo.PathSegment moved to a top-level class
1 parent 2adcf59 commit d036552

File tree

4 files changed

+95
-47
lines changed

4 files changed

+95
-47
lines changed

firebase-dataconnect/api.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,24 +61,24 @@ package com.google.firebase.dataconnect {
6161
public static interface DataConnectOperationFailureResponse.ErrorInfo {
6262
method public boolean equals(Object? other);
6363
method public String getMessage();
64-
method public java.util.List<com.google.firebase.dataconnect.DataConnectOperationFailureResponse.ErrorInfo.PathSegment> getPath();
64+
method public java.util.List<com.google.firebase.dataconnect.DataConnectPathSegment> getPath();
6565
method public int hashCode();
6666
method public String toString();
6767
property public abstract String message;
68-
property public abstract java.util.List<com.google.firebase.dataconnect.DataConnectOperationFailureResponse.ErrorInfo.PathSegment> path;
68+
property public abstract java.util.List<com.google.firebase.dataconnect.DataConnectPathSegment> path;
6969
}
7070

71-
public static sealed interface DataConnectOperationFailureResponse.ErrorInfo.PathSegment {
71+
public sealed interface DataConnectPathSegment {
7272
}
7373

74-
@kotlin.jvm.JvmInline public static final value class DataConnectOperationFailureResponse.ErrorInfo.PathSegment.Field implements com.google.firebase.dataconnect.DataConnectOperationFailureResponse.ErrorInfo.PathSegment {
75-
ctor public DataConnectOperationFailureResponse.ErrorInfo.PathSegment.Field(String field);
74+
@kotlin.jvm.JvmInline public static final value class DataConnectPathSegment.Field implements com.google.firebase.dataconnect.DataConnectPathSegment {
75+
ctor public DataConnectPathSegment.Field(String field);
7676
method public String getField();
7777
property public final String field;
7878
}
7979

80-
@kotlin.jvm.JvmInline public static final value class DataConnectOperationFailureResponse.ErrorInfo.PathSegment.ListIndex implements com.google.firebase.dataconnect.DataConnectOperationFailureResponse.ErrorInfo.PathSegment {
81-
ctor public DataConnectOperationFailureResponse.ErrorInfo.PathSegment.ListIndex(int index);
80+
@kotlin.jvm.JvmInline public static final value class DataConnectPathSegment.ListIndex implements com.google.firebase.dataconnect.DataConnectPathSegment {
81+
ctor public DataConnectPathSegment.ListIndex(int index);
8282
method public int getIndex();
8383
property public final int index;
8484
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
# Copyright 2024 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -euo pipefail
18+
19+
readonly PROJECT_ROOT_DIR="$(dirname "$0")/../.."
20+
21+
readonly args=(
22+
"${PROJECT_ROOT_DIR}/gradlew"
23+
"-p"
24+
"${PROJECT_ROOT_DIR}"
25+
"--configure-on-demand"
26+
"$@"
27+
":firebase-dataconnect:generateApiTxtFile"
28+
)
29+
30+
echo "${args[*]}"
31+
exec "${args[@]}"

firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/DataConnectOperationFailureResponse.kt

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public interface DataConnectOperationFailureResponse<Data> {
7676
public val message: String
7777

7878
/** The path of the field in the response data to which this error relates. */
79-
public val path: List<PathSegment>
79+
public val path: List<DataConnectPathSegment>
8080

8181
/**
8282
* Compares this object with another object for equality.
@@ -112,44 +112,5 @@ public interface DataConnectOperationFailureResponse<Data> {
112112
* not empty), and the message.
113113
*/
114114
override fun toString(): String
115-
116-
/** The "segment" of a path to a field in the response data. */
117-
public sealed interface PathSegment {
118-
119-
/** A named field in a path to a field in the response data. */
120-
@JvmInline
121-
public value class Field(public val field: String) : PathSegment {
122-
123-
/**
124-
* Returns a string representation of this object, useful for debugging.
125-
*
126-
* The string representation is _not_ guaranteed to be stable and may change without notice
127-
* at any time. Therefore, the only recommended usage of the returned string is debugging
128-
* and/or logging. Namely, parsing the returned string or storing the returned string in
129-
* non-volatile storage should generally be avoided in order to be robust in case that the
130-
* string representation changes.
131-
*
132-
* @return returns simply [field].
133-
*/
134-
override fun toString(): String = field
135-
}
136-
137-
/** An index of a list in a path to a field in the response data. */
138-
@JvmInline
139-
public value class ListIndex(public val index: Int) : PathSegment {
140-
/**
141-
* Returns a string representation of this object, useful for debugging.
142-
*
143-
* The string representation is _not_ guaranteed to be stable and may change without notice
144-
* at any time. Therefore, the only recommended usage of the returned string is debugging
145-
* and/or logging. Namely, parsing the returned string or storing the returned string in
146-
* non-volatile storage should generally be avoided in order to be robust in case that the
147-
* string representation changes.
148-
*
149-
* @return returns simply the string representation of [index].
150-
*/
151-
override fun toString(): String = index.toString()
152-
}
153-
}
154115
}
155116
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
* http://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+
package com.google.firebase.dataconnect
18+
19+
/** The "segment" of a path to a field in the response data. */
20+
public sealed interface DataConnectPathSegment {
21+
22+
/** A named field in a path to a field in the response data. */
23+
@JvmInline
24+
public value class Field(public val field: String) : DataConnectPathSegment {
25+
26+
/**
27+
* Returns a string representation of this object, useful for debugging.
28+
*
29+
* The string representation is _not_ guaranteed to be stable and may change without notice at
30+
* any time. Therefore, the only recommended usage of the returned string is debugging and/or
31+
* logging. Namely, parsing the returned string or storing the returned string in non-volatile
32+
* storage should generally be avoided in order to be robust in case that the string
33+
* representation changes.
34+
*
35+
* @return returns simply [field].
36+
*/
37+
override fun toString(): String = field
38+
}
39+
40+
/** An index of a list in a path to a field in the response data. */
41+
@JvmInline
42+
public value class ListIndex(public val index: Int) : DataConnectPathSegment {
43+
/**
44+
* Returns a string representation of this object, useful for debugging.
45+
*
46+
* The string representation is _not_ guaranteed to be stable and may change without notice at
47+
* any time. Therefore, the only recommended usage of the returned string is debugging and/or
48+
* logging. Namely, parsing the returned string or storing the returned string in non-volatile
49+
* storage should generally be avoided in order to be robust in case that the string
50+
* representation changes.
51+
*
52+
* @return returns simply the string representation of [index].
53+
*/
54+
override fun toString(): String = index.toString()
55+
}
56+
}

0 commit comments

Comments
 (0)