Showing 31 of 34 files from the diff.
Other files ignored by Codecov

@@ -1,24 +1,23 @@
Loading
1 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:built_value/built_value.dart';
2 2
import 'package:built_value/serializer.dart';
3 3
4 4
part 'put_segment_request.g.dart';
5 5
6 -
abstract class PutSegmentRequest implements Built<PutSegmentRequest, PutSegmentRequestBuilder> {
6 +
abstract class PutSegmentRequest
7 +
    implements Built<PutSegmentRequest, PutSegmentRequestBuilder> {
8 +
  @nullable
9 +
  @BuiltValueField(wireName: r'description')
10 +
  String get description;
7 11
8 -
    
9 -
        @nullable
10 -
    @BuiltValueField(wireName: r'description')
11 -
    String get description;
12 -
    
13 -
        @nullable
14 -
    @BuiltValueField(wireName: r'rolloutPercent')
15 -
    int get rolloutPercent;
12 +
  @nullable
13 +
  @BuiltValueField(wireName: r'rolloutPercent')
14 +
  int get rolloutPercent;
16 15
17 -
    // Boilerplate code needed to wire-up generated code
18 -
    PutSegmentRequest._();
19 -
20 -
    factory PutSegmentRequest([updates(PutSegmentRequestBuilder b)]) = _$PutSegmentRequest;
21 -
    static Serializer<PutSegmentRequest> get serializer => _$putSegmentRequestSerializer;
16 +
  // Boilerplate code needed to wire-up generated code
17 +
  PutSegmentRequest._();
22 18
19 +
  factory PutSegmentRequest([updates(PutSegmentRequestBuilder b)]) =
20 +
      _$PutSegmentRequest;
21 +
  static Serializer<PutSegmentRequest> get serializer =>
22 +
      _$putSegmentRequestSerializer;
23 23
}
24 -

@@ -9,56 +9,59 @@
Loading
9 9
import 'package:flagr/model/error.dart';
10 10
11 11
class HealthApi {
12 -
    final Dio _dio;
13 -
    Serializers _serializers;
12 +
  final Dio _dio;
13 +
  Serializers _serializers;
14 14
15 -
    HealthApi(this._dio, this._serializers);
15 +
  HealthApi(this._dio, this._serializers);
16 16
17 -
        /// 
18 -
        ///
19 -
        /// Check if Flagr is healthy
20 -
        Future<Response<Health>>getHealth({ CancelToken cancelToken, Map<String, String> headers,}) async {
17 +
  ///
18 +
  ///
19 +
  /// Check if Flagr is healthy
20 +
  Future<Response<Health>> getHealth({
21 +
    CancelToken cancelToken,
22 +
    Map<String, String> headers,
23 +
  }) async {
24 +
    String _path = "/health";
21 25
22 -
        String _path = "/health";
26 +
    Map<String, dynamic> queryParams = {};
27 +
    Map<String, String> headerParams = Map.from(headers ?? {});
28 +
    dynamic bodyData;
23 29
24 -
        Map<String, dynamic> queryParams = {};
25 -
        Map<String, String> headerParams = Map.from(headers ?? {});
26 -
        dynamic bodyData;
30 +
    queryParams.removeWhere((key, value) => value == null);
31 +
    headerParams.removeWhere((key, value) => value == null);
27 32
28 -
        queryParams.removeWhere((key, value) => value == null);
29 -
        headerParams.removeWhere((key, value) => value == null);
33 +
    List<String> contentTypes = [];
30 34
31 -
        List<String> contentTypes = [];
35 +
    return _dio
36 +
        .request(
37 +
      _path,
38 +
      queryParameters: queryParams,
39 +
      data: bodyData,
40 +
      options: Options(
41 +
        method: 'get'.toUpperCase(),
42 +
        headers: headerParams,
43 +
        extra: {
44 +
          'secure': [],
45 +
        },
46 +
        contentType:
47 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
48 +
      ),
49 +
      cancelToken: cancelToken,
50 +
    )
51 +
        .then((response) {
52 +
      var serializer = _serializers.serializerForType(Health);
53 +
      var data = _serializers.deserializeWith<Health>(serializer,
54 +
          response.data is String ? jsonDecode(response.data) : response.data);
32 55
33 -
34 -
35 -
            return _dio.request(
36 -
            _path,
37 -
            queryParameters: queryParams,
38 -
            data: bodyData,
39 -
            options: Options(
40 -
            method: 'get'.toUpperCase(),
41 -
            headers: headerParams,
42 -
            extra: {
43 -
                'secure': [],
44 -
            },
45 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
46 -
            ),
47 -
            cancelToken: cancelToken,
48 -
            ).then((response) {
49 -
50 -
        var serializer = _serializers.serializerForType(Health);
51 -
        var data = _serializers.deserializeWith<Health>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
52 -
53 -
            return Response<Health>(
54 -
                data: data,
55 -
                headers: response.headers,
56 -
                request: response.request,
57 -
                redirects: response.redirects,
58 -
                statusCode: response.statusCode,
59 -
                statusMessage: response.statusMessage,
60 -
                extra: response.extra,
61 -
            );
62 -
            });
63 -
            }
64 -
        }
56 +
      return Response<Health>(
57 +
        data: data,
58 +
        headers: response.headers,
59 +
        request: response.request,
60 +
        redirects: response.redirects,
61 +
        statusCode: response.statusCode,
62 +
        statusMessage: response.statusMessage,
63 +
        extra: response.extra,
64 +
      );
65 +
    });
66 +
  }
67 +
}

@@ -1,20 +1,19 @@
Loading
1 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:built_value/built_value.dart';
2 2
import 'package:built_value/serializer.dart';
3 3
4 4
part 'set_flag_enabled_request.g.dart';
5 5
6 -
abstract class SetFlagEnabledRequest implements Built<SetFlagEnabledRequest, SetFlagEnabledRequestBuilder> {
6 +
abstract class SetFlagEnabledRequest
7 +
    implements Built<SetFlagEnabledRequest, SetFlagEnabledRequestBuilder> {
8 +
  @nullable
9 +
  @BuiltValueField(wireName: r'enabled')
10 +
  bool get enabled;
7 11
8 -
    
9 -
        @nullable
10 -
    @BuiltValueField(wireName: r'enabled')
11 -
    bool get enabled;
12 -
13 -
    // Boilerplate code needed to wire-up generated code
14 -
    SetFlagEnabledRequest._();
15 -
16 -
    factory SetFlagEnabledRequest([updates(SetFlagEnabledRequestBuilder b)]) = _$SetFlagEnabledRequest;
17 -
    static Serializer<SetFlagEnabledRequest> get serializer => _$setFlagEnabledRequestSerializer;
12 +
  // Boilerplate code needed to wire-up generated code
13 +
  SetFlagEnabledRequest._();
18 14
15 +
  factory SetFlagEnabledRequest([updates(SetFlagEnabledRequestBuilder b)]) =
16 +
      _$SetFlagEnabledRequest;
17 +
  static Serializer<SetFlagEnabledRequest> get serializer =>
18 +
      _$setFlagEnabledRequestSerializer;
19 19
}
20 -

@@ -3,21 +3,21 @@
Loading
3 3
import 'package:dio/dio.dart';
4 4
5 5
abstract class AuthInterceptor extends Interceptor {
6 -
    /*
6 +
  /*
7 7
     * Get auth information on given route for the given type
8 8
     * Can return null if type is not present on auth data or if route doesn't need authentication
9 9
     */
10 -
    List<Map<String, dynamic>> getAuthInfo(RequestOptions route, String type) {
11 -
        if (route.extra.containsKey("secure")) {
12 -
            final auth = route.extra["secure"];
13 -
            List<Map<String, dynamic>> results = [];
14 -
            for (var info in auth) {
15 -
                if(info["type"] == type) {
16 -
                    results.add(info);
17 -
                }
18 -
            }
19 -
            return results;
10 +
  List<Map<String, dynamic>> getAuthInfo(RequestOptions route, String type) {
11 +
    if (route.extra.containsKey("secure")) {
12 +
      final auth = route.extra["secure"];
13 +
      List<Map<String, dynamic>> results = [];
14 +
      for (var info in auth) {
15 +
        if (info["type"] == type) {
16 +
          results.add(info);
20 17
        }
21 -
        return [];
18 +
      }
19 +
      return results;
22 20
    }
21 +
    return [];
22 +
  }
23 23
}

@@ -11,190 +11,221 @@
Loading
11 11
import 'package:flagr/model/put_variant_request.dart';
12 12
13 13
class VariantApi {
14 -
    final Dio _dio;
15 -
    Serializers _serializers;
16 -
17 -
    VariantApi(this._dio, this._serializers);
18 -
19 -
        /// 
20 -
        ///
21 -
        /// 
22 -
        Future<Response<Variant>>createVariant(int flagID,CreateVariantRequest body,{ CancelToken cancelToken, Map<String, String> headers,}) async {
23 -
24 -
        String _path = "/flags/{flagID}/variants".replaceAll("{" r'flagID' "}", flagID.toString());
25 -
26 -
        Map<String, dynamic> queryParams = {};
27 -
        Map<String, String> headerParams = Map.from(headers ?? {});
28 -
        dynamic bodyData;
29 -
30 -
        queryParams.removeWhere((key, value) => value == null);
31 -
        headerParams.removeWhere((key, value) => value == null);
32 -
33 -
        List<String> contentTypes = ["application/json"];
34 -
35 -
36 -
            var serializedBody = _serializers.serialize(body);
37 -
            var jsonbody = json.encode(serializedBody);
38 -
            bodyData = jsonbody;
39 -
40 -
            return _dio.request(
41 -
            _path,
42 -
            queryParameters: queryParams,
43 -
            data: bodyData,
44 -
            options: Options(
45 -
            method: 'post'.toUpperCase(),
46 -
            headers: headerParams,
47 -
            extra: {
48 -
                'secure': [],
49 -
            },
50 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
51 -
            ),
52 -
            cancelToken: cancelToken,
53 -
            ).then((response) {
54 -
55 -
        var serializer = _serializers.serializerForType(Variant);
56 -
        var data = _serializers.deserializeWith<Variant>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
57 -
58 -
            return Response<Variant>(
59 -
                data: data,
60 -
                headers: response.headers,
61 -
                request: response.request,
62 -
                redirects: response.redirects,
63 -
                statusCode: response.statusCode,
64 -
                statusMessage: response.statusMessage,
65 -
                extra: response.extra,
66 -
            );
67 -
            });
68 -
            }
69 -
        /// 
70 -
        ///
71 -
        /// 
72 -
        Future<Response>deleteVariant(int flagID,int variantID,{ CancelToken cancelToken, Map<String, String> headers,}) async {
73 -
74 -
        String _path = "/flags/{flagID}/variants/{variantID}".replaceAll("{" r'flagID' "}", flagID.toString()).replaceAll("{" r'variantID' "}", variantID.toString());
75 -
76 -
        Map<String, dynamic> queryParams = {};
77 -
        Map<String, String> headerParams = Map.from(headers ?? {});
78 -
        dynamic bodyData;
79 -
80 -
        queryParams.removeWhere((key, value) => value == null);
81 -
        headerParams.removeWhere((key, value) => value == null);
82 -
83 -
        List<String> contentTypes = [];
84 -
85 -
86 -
87 -
            return _dio.request(
88 -
            _path,
89 -
            queryParameters: queryParams,
90 -
            data: bodyData,
91 -
            options: Options(
92 -
            method: 'delete'.toUpperCase(),
93 -
            headers: headerParams,
94 -
            extra: {
95 -
                'secure': [],
96 -
            },
97 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
98 -
            ),
99 -
            cancelToken: cancelToken,
100 -
            );
101 -
            }
102 -
        /// 
103 -
        ///
104 -
        /// 
105 -
        Future<Response<List<Variant>>>findVariants(int flagID,{ CancelToken cancelToken, Map<String, String> headers,}) async {
106 -
107 -
        String _path = "/flags/{flagID}/variants".replaceAll("{" r'flagID' "}", flagID.toString());
108 -
109 -
        Map<String, dynamic> queryParams = {};
110 -
        Map<String, String> headerParams = Map.from(headers ?? {});
111 -
        dynamic bodyData;
112 -
113 -
        queryParams.removeWhere((key, value) => value == null);
114 -
        headerParams.removeWhere((key, value) => value == null);
115 -
116 -
        List<String> contentTypes = [];
117 -
118 -
119 -
120 -
            return _dio.request(
121 -
            _path,
122 -
            queryParameters: queryParams,
123 -
            data: bodyData,
124 -
            options: Options(
125 -
            method: 'get'.toUpperCase(),
126 -
            headers: headerParams,
127 -
            extra: {
128 -
                'secure': [],
129 -
            },
130 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
131 -
            ),
132 -
            cancelToken: cancelToken,
133 -
            ).then((response) {
134 -
135 -
                final FullType type = const FullType(BuiltList, const [const FullType(Variant)]);
136 -
                BuiltList<Variant> dataList = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
137 -
                var data = dataList.toList();
138 -
139 -
            return Response<List<Variant>>(
140 -
                data: data,
141 -
                headers: response.headers,
142 -
                request: response.request,
143 -
                redirects: response.redirects,
144 -
                statusCode: response.statusCode,
145 -
                statusMessage: response.statusMessage,
146 -
                extra: response.extra,
147 -
            );
148 -
            });
149 -
            }
150 -
        /// 
151 -
        ///
152 -
        /// 
153 -
        Future<Response<Variant>>putVariant(int flagID,int variantID,PutVariantRequest body,{ CancelToken cancelToken, Map<String, String> headers,}) async {
154 -
155 -
        String _path = "/flags/{flagID}/variants/{variantID}".replaceAll("{" r'flagID' "}", flagID.toString()).replaceAll("{" r'variantID' "}", variantID.toString());
156 -
157 -
        Map<String, dynamic> queryParams = {};
158 -
        Map<String, String> headerParams = Map.from(headers ?? {});
159 -
        dynamic bodyData;
160 -
161 -
        queryParams.removeWhere((key, value) => value == null);
162 -
        headerParams.removeWhere((key, value) => value == null);
163 -
164 -
        List<String> contentTypes = ["application/json"];
165 -
166 -
167 -
            var serializedBody = _serializers.serialize(body);
168 -
            var jsonbody = json.encode(serializedBody);
169 -
            bodyData = jsonbody;
170 -
171 -
            return _dio.request(
172 -
            _path,
173 -
            queryParameters: queryParams,
174 -
            data: bodyData,
175 -
            options: Options(
176 -
            method: 'put'.toUpperCase(),
177 -
            headers: headerParams,
178 -
            extra: {
179 -
                'secure': [],
180 -
            },
181 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
182 -
            ),
183 -
            cancelToken: cancelToken,
184 -
            ).then((response) {
185 -
186 -
        var serializer = _serializers.serializerForType(Variant);
187 -
        var data = _serializers.deserializeWith<Variant>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
188 -
189 -
            return Response<Variant>(
190 -
                data: data,
191 -
                headers: response.headers,
192 -
                request: response.request,
193 -
                redirects: response.redirects,
194 -
                statusCode: response.statusCode,
195 -
                statusMessage: response.statusMessage,
196 -
                extra: response.extra,
197 -
            );
198 -
            });
199 -
            }
200 -
        }
14 +
  final Dio _dio;
15 +
  Serializers _serializers;
16 +
17 +
  VariantApi(this._dio, this._serializers);
18 +
19 +
  ///
20 +
  ///
21 +
  ///
22 +
  Future<Response<Variant>> createVariant(
23 +
    int flagID,
24 +
    CreateVariantRequest body, {
25 +
    CancelToken cancelToken,
26 +
    Map<String, String> headers,
27 +
  }) async {
28 +
    String _path = "/flags/{flagID}/variants"
29 +
        .replaceAll("{" r'flagID' "}", flagID.toString());
30 +
31 +
    Map<String, dynamic> queryParams = {};
32 +
    Map<String, String> headerParams = Map.from(headers ?? {});
33 +
    dynamic bodyData;
34 +
35 +
    queryParams.removeWhere((key, value) => value == null);
36 +
    headerParams.removeWhere((key, value) => value == null);
37 +
38 +
    List<String> contentTypes = ["application/json"];
39 +
40 +
    var serializedBody = _serializers.serialize(body);
41 +
    var jsonbody = json.encode(serializedBody);
42 +
    bodyData = jsonbody;
43 +
44 +
    return _dio
45 +
        .request(
46 +
      _path,
47 +
      queryParameters: queryParams,
48 +
      data: bodyData,
49 +
      options: Options(
50 +
        method: 'post'.toUpperCase(),
51 +
        headers: headerParams,
52 +
        extra: {
53 +
          'secure': [],
54 +
        },
55 +
        contentType:
56 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
57 +
      ),
58 +
      cancelToken: cancelToken,
59 +
    )
60 +
        .then((response) {
61 +
      var serializer = _serializers.serializerForType(Variant);
62 +
      var data = _serializers.deserializeWith<Variant>(serializer,
63 +
          response.data is String ? jsonDecode(response.data) : response.data);
64 +
65 +
      return Response<Variant>(
66 +
        data: data,
67 +
        headers: response.headers,
68 +
        request: response.request,
69 +
        redirects: response.redirects,
70 +
        statusCode: response.statusCode,
71 +
        statusMessage: response.statusMessage,
72 +
        extra: response.extra,
73 +
      );
74 +
    });
75 +
  }
76 +
77 +
  ///
78 +
  ///
79 +
  ///
80 +
  Future<Response> deleteVariant(
81 +
    int flagID,
82 +
    int variantID, {
83 +
    CancelToken cancelToken,
84 +
    Map<String, String> headers,
85 +
  }) async {
86 +
    String _path = "/flags/{flagID}/variants/{variantID}"
87 +
        .replaceAll("{" r'flagID' "}", flagID.toString())
88 +
        .replaceAll("{" r'variantID' "}", variantID.toString());
89 +
90 +
    Map<String, dynamic> queryParams = {};
91 +
    Map<String, String> headerParams = Map.from(headers ?? {});
92 +
    dynamic bodyData;
93 +
94 +
    queryParams.removeWhere((key, value) => value == null);
95 +
    headerParams.removeWhere((key, value) => value == null);
96 +
97 +
    List<String> contentTypes = [];
98 +
99 +
    return _dio.request(
100 +
      _path,
101 +
      queryParameters: queryParams,
102 +
      data: bodyData,
103 +
      options: Options(
104 +
        method: 'delete'.toUpperCase(),
105 +
        headers: headerParams,
106 +
        extra: {
107 +
          'secure': [],
108 +
        },
109 +
        contentType:
110 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
111 +
      ),
112 +
      cancelToken: cancelToken,
113 +
    );
114 +
  }
115 +
116 +
  ///
117 +
  ///
118 +
  ///
119 +
  Future<Response<List<Variant>>> findVariants(
120 +
    int flagID, {
121 +
    CancelToken cancelToken,
122 +
    Map<String, String> headers,
123 +
  }) async {
124 +
    String _path = "/flags/{flagID}/variants"
125 +
        .replaceAll("{" r'flagID' "}", flagID.toString());
126 +
127 +
    Map<String, dynamic> queryParams = {};
128 +
    Map<String, String> headerParams = Map.from(headers ?? {});
129 +
    dynamic bodyData;
130 +
131 +
    queryParams.removeWhere((key, value) => value == null);
132 +
    headerParams.removeWhere((key, value) => value == null);
133 +
134 +
    List<String> contentTypes = [];
135 +
136 +
    return _dio
137 +
        .request(
138 +
      _path,
139 +
      queryParameters: queryParams,
140 +
      data: bodyData,
141 +
      options: Options(
142 +
        method: 'get'.toUpperCase(),
143 +
        headers: headerParams,
144 +
        extra: {
145 +
          'secure': [],
146 +
        },
147 +
        contentType:
148 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
149 +
      ),
150 +
      cancelToken: cancelToken,
151 +
    )
152 +
        .then((response) {
153 +
      final FullType type =
154 +
          const FullType(BuiltList, const [const FullType(Variant)]);
155 +
      BuiltList<Variant> dataList = _serializers.deserialize(
156 +
          response.data is String ? jsonDecode(response.data) : response.data,
157 +
          specifiedType: type);
158 +
      var data = dataList.toList();
159 +
160 +
      return Response<List<Variant>>(
161 +
        data: data,
162 +
        headers: response.headers,
163 +
        request: response.request,
164 +
        redirects: response.redirects,
165 +
        statusCode: response.statusCode,
166 +
        statusMessage: response.statusMessage,
167 +
        extra: response.extra,
168 +
      );
169 +
    });
170 +
  }
171 +
172 +
  ///
173 +
  ///
174 +
  ///
175 +
  Future<Response<Variant>> putVariant(
176 +
    int flagID,
177 +
    int variantID,
178 +
    PutVariantRequest body, {
179 +
    CancelToken cancelToken,
180 +
    Map<String, String> headers,
181 +
  }) async {
182 +
    String _path = "/flags/{flagID}/variants/{variantID}"
183 +
        .replaceAll("{" r'flagID' "}", flagID.toString())
184 +
        .replaceAll("{" r'variantID' "}", variantID.toString());
185 +
186 +
    Map<String, dynamic> queryParams = {};
187 +
    Map<String, String> headerParams = Map.from(headers ?? {});
188 +
    dynamic bodyData;
189 +
190 +
    queryParams.removeWhere((key, value) => value == null);
191 +
    headerParams.removeWhere((key, value) => value == null);
192 +
193 +
    List<String> contentTypes = ["application/json"];
194 +
195 +
    var serializedBody = _serializers.serialize(body);
196 +
    var jsonbody = json.encode(serializedBody);
197 +
    bodyData = jsonbody;
198 +
199 +
    return _dio
200 +
        .request(
201 +
      _path,
202 +
      queryParameters: queryParams,
203 +
      data: bodyData,
204 +
      options: Options(
205 +
        method: 'put'.toUpperCase(),
206 +
        headers: headerParams,
207 +
        extra: {
208 +
          'secure': [],
209 +
        },
210 +
        contentType:
211 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
212 +
      ),
213 +
      cancelToken: cancelToken,
214 +
    )
215 +
        .then((response) {
216 +
      var serializer = _serializers.serializerForType(Variant);
217 +
      var data = _serializers.deserializeWith<Variant>(serializer,
218 +
          response.data is String ? jsonDecode(response.data) : response.data);
219 +
220 +
      return Response<Variant>(
221 +
        data: data,
222 +
        headers: response.headers,
223 +
        request: response.request,
224 +
        redirects: response.redirects,
225 +
        statusCode: response.statusCode,
226 +
        statusMessage: response.statusMessage,
227 +
        extra: response.extra,
228 +
      );
229 +
    });
230 +
  }
231 +
}

@@ -1,20 +1,16 @@
Loading
1 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:built_value/built_value.dart';
2 2
import 'package:built_value/serializer.dart';
3 3
4 4
part 'health.g.dart';
5 5
6 6
abstract class Health implements Built<Health, HealthBuilder> {
7 +
  @nullable
8 +
  @BuiltValueField(wireName: r'status')
9 +
  String get status;
7 10
8 -
    
9 -
        @nullable
10 -
    @BuiltValueField(wireName: r'status')
11 -
    String get status;
12 -
13 -
    // Boilerplate code needed to wire-up generated code
14 -
    Health._();
15 -
16 -
    factory Health([updates(HealthBuilder b)]) = _$Health;
17 -
    static Serializer<Health> get serializer => _$healthSerializer;
11 +
  // Boilerplate code needed to wire-up generated code
12 +
  Health._();
18 13
14 +
  factory Health([updates(HealthBuilder b)]) = _$Health;
15 +
  static Serializer<Health> get serializer => _$healthSerializer;
19 16
}
20 -

@@ -1,21 +1,22 @@
Loading
1 -
            import 'package:built_collection/built_collection.dart';
2 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:built_collection/built_collection.dart';
2 +
import 'package:built_value/built_value.dart';
3 3
import 'package:built_value/serializer.dart';
4 4
5 5
part 'put_segment_reorder_request.g.dart';
6 6
7 -
abstract class PutSegmentReorderRequest implements Built<PutSegmentReorderRequest, PutSegmentReorderRequestBuilder> {
7 +
abstract class PutSegmentReorderRequest
8 +
    implements
9 +
        Built<PutSegmentReorderRequest, PutSegmentReorderRequestBuilder> {
10 +
  @nullable
11 +
  @BuiltValueField(wireName: r'segmentIDs')
12 +
  BuiltList<int> get segmentIDs;
8 13
9 -
    
10 -
        @nullable
11 -
    @BuiltValueField(wireName: r'segmentIDs')
12 -
    BuiltList<int> get segmentIDs;
13 -
14 -
    // Boilerplate code needed to wire-up generated code
15 -
    PutSegmentReorderRequest._();
16 -
17 -
    factory PutSegmentReorderRequest([updates(PutSegmentReorderRequestBuilder b)]) = _$PutSegmentReorderRequest;
18 -
    static Serializer<PutSegmentReorderRequest> get serializer => _$putSegmentReorderRequestSerializer;
14 +
  // Boilerplate code needed to wire-up generated code
15 +
  PutSegmentReorderRequest._();
19 16
17 +
  factory PutSegmentReorderRequest(
18 +
          [updates(PutSegmentReorderRequestBuilder b)]) =
19 +
      _$PutSegmentReorderRequest;
20 +
  static Serializer<PutSegmentReorderRequest> get serializer =>
21 +
      _$putSegmentReorderRequestSerializer;
20 22
}
21 -

@@ -1,43 +1,39 @@
Loading
1 -
            import 'package:flagr/model/constraint.dart';
2 -
            import 'package:built_collection/built_collection.dart';
3 -
            import 'package:flagr/model/distribution.dart';
4 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:flagr/model/constraint.dart';
2 +
import 'package:built_collection/built_collection.dart';
3 +
import 'package:flagr/model/distribution.dart';
4 +
import 'package:built_value/built_value.dart';
5 5
import 'package:built_value/serializer.dart';
6 6
7 7
part 'segment.g.dart';
8 8
9 9
abstract class Segment implements Built<Segment, SegmentBuilder> {
10 +
  @nullable
11 +
  @BuiltValueField(wireName: r'id')
12 +
  int get id;
10 13
11 -
    
12 -
        @nullable
13 -
    @BuiltValueField(wireName: r'id')
14 -
    int get id;
15 -
    
16 -
        @nullable
17 -
    @BuiltValueField(wireName: r'description')
18 -
    String get description;
19 -
    
20 -
        @nullable
21 -
    @BuiltValueField(wireName: r'constraints')
22 -
    BuiltList<Constraint> get constraints;
23 -
    
24 -
        @nullable
25 -
    @BuiltValueField(wireName: r'distributions')
26 -
    BuiltList<Distribution> get distributions;
27 -
    
28 -
        @nullable
29 -
    @BuiltValueField(wireName: r'rank')
30 -
    int get rank;
31 -
    
32 -
        @nullable
33 -
    @BuiltValueField(wireName: r'rolloutPercent')
34 -
    int get rolloutPercent;
35 -
36 -
    // Boilerplate code needed to wire-up generated code
37 -
    Segment._();
38 -
39 -
    factory Segment([updates(SegmentBuilder b)]) = _$Segment;
40 -
    static Serializer<Segment> get serializer => _$segmentSerializer;
14 +
  @nullable
15 +
  @BuiltValueField(wireName: r'description')
16 +
  String get description;
41 17
42 -
}
18 +
  @nullable
19 +
  @BuiltValueField(wireName: r'constraints')
20 +
  BuiltList<Constraint> get constraints;
21 +
22 +
  @nullable
23 +
  @BuiltValueField(wireName: r'distributions')
24 +
  BuiltList<Distribution> get distributions;
25 +
26 +
  @nullable
27 +
  @BuiltValueField(wireName: r'rank')
28 +
  int get rank;
43 29
30 +
  @nullable
31 +
  @BuiltValueField(wireName: r'rolloutPercent')
32 +
  int get rolloutPercent;
33 +
34 +
  // Boilerplate code needed to wire-up generated code
35 +
  Segment._();
36 +
37 +
  factory Segment([updates(SegmentBuilder b)]) = _$Segment;
38 +
  static Serializer<Segment> get serializer => _$segmentSerializer;
39 +
}

@@ -1,40 +1,38 @@
Loading
1 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:built_value/built_value.dart';
2 2
import 'package:built_value/serializer.dart';
3 3
4 4
part 'put_flag_request.g.dart';
5 5
6 -
abstract class PutFlagRequest implements Built<PutFlagRequest, PutFlagRequestBuilder> {
6 +
abstract class PutFlagRequest
7 +
    implements Built<PutFlagRequest, PutFlagRequestBuilder> {
8 +
  @nullable
9 +
  @BuiltValueField(wireName: r'description')
10 +
  String get description;
11 +
  /* enabled data records will get data logging in the metrics pipeline, for example, kafka. */
12 +
  @nullable
13 +
  @BuiltValueField(wireName: r'dataRecordsEnabled')
14 +
  bool get dataRecordsEnabled;
15 +
  /* it will overwrite entityType into evaluation logs if it's not empty */
16 +
  @nullable
17 +
  @BuiltValueField(wireName: r'entityType')
18 +
  String get entityType;
7 19
8 -
    
9 -
        @nullable
10 -
    @BuiltValueField(wireName: r'description')
11 -
    String get description;
12 -
    /* enabled data records will get data logging in the metrics pipeline, for example, kafka. */
13 -
        @nullable
14 -
    @BuiltValueField(wireName: r'dataRecordsEnabled')
15 -
    bool get dataRecordsEnabled;
16 -
    /* it will overwrite entityType into evaluation logs if it's not empty */
17 -
        @nullable
18 -
    @BuiltValueField(wireName: r'entityType')
19 -
    String get entityType;
20 -
    
21 -
        @nullable
22 -
    @BuiltValueField(wireName: r'enabled')
23 -
    bool get enabled;
24 -
    
25 -
        @nullable
26 -
    @BuiltValueField(wireName: r'key')
27 -
    String get key;
28 -
    
29 -
        @nullable
30 -
    @BuiltValueField(wireName: r'notes')
31 -
    String get notes;
20 +
  @nullable
21 +
  @BuiltValueField(wireName: r'enabled')
22 +
  bool get enabled;
32 23
33 -
    // Boilerplate code needed to wire-up generated code
34 -
    PutFlagRequest._();
24 +
  @nullable
25 +
  @BuiltValueField(wireName: r'key')
26 +
  String get key;
35 27
36 -
    factory PutFlagRequest([updates(PutFlagRequestBuilder b)]) = _$PutFlagRequest;
37 -
    static Serializer<PutFlagRequest> get serializer => _$putFlagRequestSerializer;
28 +
  @nullable
29 +
  @BuiltValueField(wireName: r'notes')
30 +
  String get notes;
38 31
39 -
}
32 +
  // Boilerplate code needed to wire-up generated code
33 +
  PutFlagRequest._();
40 34
35 +
  factory PutFlagRequest([updates(PutFlagRequestBuilder b)]) = _$PutFlagRequest;
36 +
  static Serializer<PutFlagRequest> get serializer =>
37 +
      _$putFlagRequestSerializer;
38 +
}

@@ -1,22 +1,21 @@
Loading
1 -
            import 'package:built_collection/built_collection.dart';
2 -
            import 'package:flagr/model/distribution.dart';
3 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:built_collection/built_collection.dart';
2 +
import 'package:flagr/model/distribution.dart';
3 +
import 'package:built_value/built_value.dart';
4 4
import 'package:built_value/serializer.dart';
5 5
6 6
part 'put_distributions_request.g.dart';
7 7
8 -
abstract class PutDistributionsRequest implements Built<PutDistributionsRequest, PutDistributionsRequestBuilder> {
8 +
abstract class PutDistributionsRequest
9 +
    implements Built<PutDistributionsRequest, PutDistributionsRequestBuilder> {
10 +
  @nullable
11 +
  @BuiltValueField(wireName: r'distributions')
12 +
  BuiltList<Distribution> get distributions;
9 13
10 -
    
11 -
        @nullable
12 -
    @BuiltValueField(wireName: r'distributions')
13 -
    BuiltList<Distribution> get distributions;
14 -
15 -
    // Boilerplate code needed to wire-up generated code
16 -
    PutDistributionsRequest._();
17 -
18 -
    factory PutDistributionsRequest([updates(PutDistributionsRequestBuilder b)]) = _$PutDistributionsRequest;
19 -
    static Serializer<PutDistributionsRequest> get serializer => _$putDistributionsRequestSerializer;
14 +
  // Boilerplate code needed to wire-up generated code
15 +
  PutDistributionsRequest._();
20 16
17 +
  factory PutDistributionsRequest([updates(PutDistributionsRequestBuilder b)]) =
18 +
      _$PutDistributionsRequest;
19 +
  static Serializer<PutDistributionsRequest> get serializer =>
20 +
      _$putDistributionsRequestSerializer;
21 21
}
22 -

@@ -1,20 +1,16 @@
Loading
1 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:built_value/built_value.dart';
2 2
import 'package:built_value/serializer.dart';
3 3
4 4
part 'error.g.dart';
5 5
6 6
abstract class Error implements Built<Error, ErrorBuilder> {
7 +
  @nullable
8 +
  @BuiltValueField(wireName: r'message')
9 +
  String get message;
7 10
8 -
    
9 -
        @nullable
10 -
    @BuiltValueField(wireName: r'message')
11 -
    String get message;
12 -
13 -
    // Boilerplate code needed to wire-up generated code
14 -
    Error._();
15 -
16 -
    factory Error([updates(ErrorBuilder b)]) = _$Error;
17 -
    static Serializer<Error> get serializer => _$errorSerializer;
11 +
  // Boilerplate code needed to wire-up generated code
12 +
  Error._();
18 13
14 +
  factory Error([updates(ErrorBuilder b)]) = _$Error;
15 +
  static Serializer<Error> get serializer => _$errorSerializer;
19 16
}
20 -

@@ -1,32 +1,29 @@
Loading
1 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:built_value/built_value.dart';
2 2
import 'package:built_value/serializer.dart';
3 3
4 4
part 'distribution.g.dart';
5 5
6 -
abstract class Distribution implements Built<Distribution, DistributionBuilder> {
6 +
abstract class Distribution
7 +
    implements Built<Distribution, DistributionBuilder> {
8 +
  @nullable
9 +
  @BuiltValueField(wireName: r'id')
10 +
  int get id;
7 11
8 -
    
9 -
        @nullable
10 -
    @BuiltValueField(wireName: r'id')
11 -
    int get id;
12 -
    
13 -
        @nullable
14 -
    @BuiltValueField(wireName: r'percent')
15 -
    int get percent;
16 -
    
17 -
        @nullable
18 -
    @BuiltValueField(wireName: r'variantKey')
19 -
    String get variantKey;
20 -
    
21 -
        @nullable
22 -
    @BuiltValueField(wireName: r'variantID')
23 -
    int get variantID;
12 +
  @nullable
13 +
  @BuiltValueField(wireName: r'percent')
14 +
  int get percent;
24 15
25 -
    // Boilerplate code needed to wire-up generated code
26 -
    Distribution._();
16 +
  @nullable
17 +
  @BuiltValueField(wireName: r'variantKey')
18 +
  String get variantKey;
27 19
28 -
    factory Distribution([updates(DistributionBuilder b)]) = _$Distribution;
29 -
    static Serializer<Distribution> get serializer => _$distributionSerializer;
20 +
  @nullable
21 +
  @BuiltValueField(wireName: r'variantID')
22 +
  int get variantID;
30 23
31 -
}
24 +
  // Boilerplate code needed to wire-up generated code
25 +
  Distribution._();
32 26
27 +
  factory Distribution([updates(DistributionBuilder b)]) = _$Distribution;
28 +
  static Serializer<Distribution> get serializer => _$distributionSerializer;
29 +
}

@@ -1,33 +1,30 @@
Loading
1 -
            import 'package:flagr/model/flag.dart';
2 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:flagr/model/flag.dart';
2 +
import 'package:built_value/built_value.dart';
3 3
import 'package:built_value/serializer.dart';
4 4
5 5
part 'flag_snapshot.g.dart';
6 6
7 -
abstract class FlagSnapshot implements Built<FlagSnapshot, FlagSnapshotBuilder> {
7 +
abstract class FlagSnapshot
8 +
    implements Built<FlagSnapshot, FlagSnapshotBuilder> {
9 +
  @nullable
10 +
  @BuiltValueField(wireName: r'id')
11 +
  int get id;
8 12
9 -
    
10 -
        @nullable
11 -
    @BuiltValueField(wireName: r'id')
12 -
    int get id;
13 -
    
14 -
        @nullable
15 -
    @BuiltValueField(wireName: r'updatedBy')
16 -
    String get updatedBy;
17 -
    
18 -
        @nullable
19 -
    @BuiltValueField(wireName: r'flag')
20 -
    Flag get flag;
21 -
    
22 -
        @nullable
23 -
    @BuiltValueField(wireName: r'updatedAt')
24 -
    String get updatedAt;
13 +
  @nullable
14 +
  @BuiltValueField(wireName: r'updatedBy')
15 +
  String get updatedBy;
25 16
26 -
    // Boilerplate code needed to wire-up generated code
27 -
    FlagSnapshot._();
17 +
  @nullable
18 +
  @BuiltValueField(wireName: r'flag')
19 +
  Flag get flag;
28 20
29 -
    factory FlagSnapshot([updates(FlagSnapshotBuilder b)]) = _$FlagSnapshot;
30 -
    static Serializer<FlagSnapshot> get serializer => _$flagSnapshotSerializer;
21 +
  @nullable
22 +
  @BuiltValueField(wireName: r'updatedAt')
23 +
  String get updatedAt;
31 24
32 -
}
25 +
  // Boilerplate code needed to wire-up generated code
26 +
  FlagSnapshot._();
33 27
28 +
  factory FlagSnapshot([updates(FlagSnapshotBuilder b)]) = _$FlagSnapshot;
29 +
  static Serializer<FlagSnapshot> get serializer => _$flagSnapshotSerializer;
30 +
}

@@ -1,25 +1,24 @@
Loading
1 -
            import 'package:built_value/json_object.dart';
2 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:built_value/json_object.dart';
2 +
import 'package:built_value/built_value.dart';
3 3
import 'package:built_value/serializer.dart';
4 4
5 5
part 'put_variant_request.g.dart';
6 6
7 -
abstract class PutVariantRequest implements Built<PutVariantRequest, PutVariantRequestBuilder> {
7 +
abstract class PutVariantRequest
8 +
    implements Built<PutVariantRequest, PutVariantRequestBuilder> {
9 +
  @nullable
10 +
  @BuiltValueField(wireName: r'key')
11 +
  String get key;
8 12
9 -
    
10 -
        @nullable
11 -
    @BuiltValueField(wireName: r'key')
12 -
    String get key;
13 -
    
14 -
        @nullable
15 -
    @BuiltValueField(wireName: r'attachment')
16 -
    JsonObject get attachment;
13 +
  @nullable
14 +
  @BuiltValueField(wireName: r'attachment')
15 +
  JsonObject get attachment;
17 16
18 -
    // Boilerplate code needed to wire-up generated code
19 -
    PutVariantRequest._();
20 -
21 -
    factory PutVariantRequest([updates(PutVariantRequestBuilder b)]) = _$PutVariantRequest;
22 -
    static Serializer<PutVariantRequest> get serializer => _$putVariantRequestSerializer;
17 +
  // Boilerplate code needed to wire-up generated code
18 +
  PutVariantRequest._();
23 19
20 +
  factory PutVariantRequest([updates(PutVariantRequestBuilder b)]) =
21 +
      _$PutVariantRequest;
22 +
  static Serializer<PutVariantRequest> get serializer =>
23 +
      _$putVariantRequestSerializer;
24 24
}
25 -

@@ -9,103 +9,110 @@
Loading
9 9
import 'dart:typed_data';
10 10
11 11
class ExportApi {
12 -
    final Dio _dio;
13 -
    Serializers _serializers;
14 -
15 -
    ExportApi(this._dio, this._serializers);
16 -
17 -
        /// 
18 -
        ///
19 -
        /// Export JSON format of the eval cache dump
20 -
        Future<Response<Object>>getExportEvalCacheJSON({ CancelToken cancelToken, Map<String, String> headers,}) async {
21 -
22 -
        String _path = "/export/eval_cache/json";
23 -
24 -
        Map<String, dynamic> queryParams = {};
25 -
        Map<String, String> headerParams = Map.from(headers ?? {});
26 -
        dynamic bodyData;
27 -
28 -
        queryParams.removeWhere((key, value) => value == null);
29 -
        headerParams.removeWhere((key, value) => value == null);
30 -
31 -
        List<String> contentTypes = [];
32 -
33 -
34 -
35 -
            return _dio.request(
36 -
            _path,
37 -
            queryParameters: queryParams,
38 -
            data: bodyData,
39 -
            options: Options(
40 -
            method: 'get'.toUpperCase(),
41 -
            headers: headerParams,
42 -
            extra: {
43 -
                'secure': [],
44 -
            },
45 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
46 -
            ),
47 -
            cancelToken: cancelToken,
48 -
            ).then((response) {
49 -
50 -
        var serializer = _serializers.serializerForType(Object);
51 -
        var data = _serializers.deserializeWith<Object>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
52 -
53 -
            return Response<Object>(
54 -
                data: data,
55 -
                headers: response.headers,
56 -
                request: response.request,
57 -
                redirects: response.redirects,
58 -
                statusCode: response.statusCode,
59 -
                statusMessage: response.statusMessage,
60 -
                extra: response.extra,
61 -
            );
62 -
            });
63 -
            }
64 -
        /// 
65 -
        ///
66 -
        /// Export sqlite3 format of the db dump, which is converted from the main database.
67 -
        Future<Response<Uint8List>>getExportSqlite({ CancelToken cancelToken, Map<String, String> headers,}) async {
68 -
69 -
        String _path = "/export/sqlite";
70 -
71 -
        Map<String, dynamic> queryParams = {};
72 -
        Map<String, String> headerParams = Map.from(headers ?? {});
73 -
        dynamic bodyData;
74 -
75 -
        queryParams.removeWhere((key, value) => value == null);
76 -
        headerParams.removeWhere((key, value) => value == null);
77 -
78 -
        List<String> contentTypes = [];
79 -
80 -
81 -
82 -
            return _dio.request(
83 -
            _path,
84 -
            queryParameters: queryParams,
85 -
            data: bodyData,
86 -
            options: Options(
87 -
            method: 'get'.toUpperCase(),
88 -
            headers: headerParams,
89 -
            extra: {
90 -
                'secure': [],
91 -
            },
92 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
93 -
            ),
94 -
            cancelToken: cancelToken,
95 -
            ).then((response) {
96 -
97 -
        var serializer = _serializers.serializerForType(Uint8List);
98 -
        var data = _serializers.deserializeWith<Uint8List>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
99 -
100 -
            return Response<Uint8List>(
101 -
                data: data,
102 -
                headers: response.headers,
103 -
                request: response.request,
104 -
                redirects: response.redirects,
105 -
                statusCode: response.statusCode,
106 -
                statusMessage: response.statusMessage,
107 -
                extra: response.extra,
108 -
            );
109 -
            });
110 -
            }
111 -
        }
12 +
  final Dio _dio;
13 +
  Serializers _serializers;
14 +
15 +
  ExportApi(this._dio, this._serializers);
16 +
17 +
  ///
18 +
  ///
19 +
  /// Export JSON format of the eval cache dump
20 +
  Future<Response<Object>> getExportEvalCacheJSON({
21 +
    CancelToken cancelToken,
22 +
    Map<String, String> headers,
23 +
  }) async {
24 +
    String _path = "/export/eval_cache/json";
25 +
26 +
    Map<String, dynamic> queryParams = {};
27 +
    Map<String, String> headerParams = Map.from(headers ?? {});
28 +
    dynamic bodyData;
29 +
30 +
    queryParams.removeWhere((key, value) => value == null);
31 +
    headerParams.removeWhere((key, value) => value == null);
32 +
33 +
    List<String> contentTypes = [];
34 +
35 +
    return _dio
36 +
        .request(
37 +
      _path,
38 +
      queryParameters: queryParams,
39 +
      data: bodyData,
40 +
      options: Options(
41 +
        method: 'get'.toUpperCase(),
42 +
        headers: headerParams,
43 +
        extra: {
44 +
          'secure': [],
45 +
        },
46 +
        contentType:
47 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
48 +
      ),
49 +
      cancelToken: cancelToken,
50 +
    )
51 +
        .then((response) {
52 +
      var serializer = _serializers.serializerForType(Object);
53 +
      var data = _serializers.deserializeWith<Object>(serializer,
54 +
          response.data is String ? jsonDecode(response.data) : response.data);
55 +
56 +
      return Response<Object>(
57 +
        data: data,
58 +
        headers: response.headers,
59 +
        request: response.request,
60 +
        redirects: response.redirects,
61 +
        statusCode: response.statusCode,
62 +
        statusMessage: response.statusMessage,
63 +
        extra: response.extra,
64 +
      );
65 +
    });
66 +
  }
67 +
68 +
  ///
69 +
  ///
70 +
  /// Export sqlite3 format of the db dump, which is converted from the main database.
71 +
  Future<Response<Uint8List>> getExportSqlite({
72 +
    CancelToken cancelToken,
73 +
    Map<String, String> headers,
74 +
  }) async {
75 +
    String _path = "/export/sqlite";
76 +
77 +
    Map<String, dynamic> queryParams = {};
78 +
    Map<String, String> headerParams = Map.from(headers ?? {});
79 +
    dynamic bodyData;
80 +
81 +
    queryParams.removeWhere((key, value) => value == null);
82 +
    headerParams.removeWhere((key, value) => value == null);
83 +
84 +
    List<String> contentTypes = [];
85 +
86 +
    return _dio
87 +
        .request(
88 +
      _path,
89 +
      queryParameters: queryParams,
90 +
      data: bodyData,
91 +
      options: Options(
92 +
        method: 'get'.toUpperCase(),
93 +
        headers: headerParams,
94 +
        extra: {
95 +
          'secure': [],
96 +
        },
97 +
        contentType:
98 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
99 +
      ),
100 +
      cancelToken: cancelToken,
101 +
    )
102 +
        .then((response) {
103 +
      var serializer = _serializers.serializerForType(Uint8List);
104 +
      var data = _serializers.deserializeWith<Uint8List>(serializer,
105 +
          response.data is String ? jsonDecode(response.data) : response.data);
106 +
107 +
      return Response<Uint8List>(
108 +
        data: data,
109 +
        headers: response.headers,
110 +
        request: response.request,
111 +
        redirects: response.redirects,
112 +
        statusCode: response.statusCode,
113 +
        statusMessage: response.statusMessage,
114 +
        extra: response.extra,
115 +
      );
116 +
    });
117 +
  }
118 +
}

@@ -33,121 +33,126 @@
Loading
33 33
import 'package:flagr/model/set_flag_enabled_request.dart';
34 34
import 'package:flagr/model/variant.dart';
35 35
36 -
37 36
part 'serializers.g.dart';
38 37
39 38
@SerializersFor(const [
40 -
Constraint,
41 -
CreateConstraintRequest,
42 -
CreateFlagRequest,
43 -
CreateSegmentRequest,
44 -
CreateVariantRequest,
45 -
Distribution,
46 -
Error,
47 -
EvalContext,
48 -
EvalDebugLog,
49 -
EvalResult,
50 -
EvaluationBatchRequest,
51 -
EvaluationBatchResponse,
52 -
EvaluationEntity,
53 -
Flag,
54 -
FlagSnapshot,
55 -
Health,
56 -
PutDistributionsRequest,
57 -
PutFlagRequest,
58 -
PutSegmentReorderRequest,
59 -
PutSegmentRequest,
60 -
PutVariantRequest,
61 -
Segment,
62 -
SegmentDebugLog,
63 -
SetFlagEnabledRequest,
64 -
Variant,
65 -
39 +
  Constraint,
40 +
  CreateConstraintRequest,
41 +
  CreateFlagRequest,
42 +
  CreateSegmentRequest,
43 +
  CreateVariantRequest,
44 +
  Distribution,
45 +
  Error,
46 +
  EvalContext,
47 +
  EvalDebugLog,
48 +
  EvalResult,
49 +
  EvaluationBatchRequest,
50 +
  EvaluationBatchResponse,
51 +
  EvaluationEntity,
52 +
  Flag,
53 +
  FlagSnapshot,
54 +
  Health,
55 +
  PutDistributionsRequest,
56 +
  PutFlagRequest,
57 +
  PutSegmentReorderRequest,
58 +
  PutSegmentRequest,
59 +
  PutVariantRequest,
60 +
  Segment,
61 +
  SegmentDebugLog,
62 +
  SetFlagEnabledRequest,
63 +
  Variant,
66 64
])
67 65
68 66
//allow all models to be serialized within a list
69 67
Serializers serializers = (_$serializers.toBuilder()
70 -
..addBuilderFactory(
71 -
const FullType(BuiltList, const [const FullType(Constraint)]),
72 -
() => new ListBuilder<Constraint>())
73 -
..addBuilderFactory(
74 -
const FullType(BuiltList, const [const FullType(CreateConstraintRequest)]),
75 -
() => new ListBuilder<CreateConstraintRequest>())
76 -
..addBuilderFactory(
77 -
const FullType(BuiltList, const [const FullType(CreateFlagRequest)]),
78 -
() => new ListBuilder<CreateFlagRequest>())
79 -
..addBuilderFactory(
80 -
const FullType(BuiltList, const [const FullType(CreateSegmentRequest)]),
81 -
() => new ListBuilder<CreateSegmentRequest>())
82 -
..addBuilderFactory(
83 -
const FullType(BuiltList, const [const FullType(CreateVariantRequest)]),
84 -
() => new ListBuilder<CreateVariantRequest>())
85 -
..addBuilderFactory(
86 -
const FullType(BuiltList, const [const FullType(Distribution)]),
87 -
() => new ListBuilder<Distribution>())
88 -
..addBuilderFactory(
89 -
const FullType(BuiltList, const [const FullType(Error)]),
90 -
() => new ListBuilder<Error>())
91 -
..addBuilderFactory(
92 -
const FullType(BuiltList, const [const FullType(EvalContext)]),
93 -
() => new ListBuilder<EvalContext>())
94 -
..addBuilderFactory(
95 -
const FullType(BuiltList, const [const FullType(EvalDebugLog)]),
96 -
() => new ListBuilder<EvalDebugLog>())
97 -
..addBuilderFactory(
98 -
const FullType(BuiltList, const [const FullType(EvalResult)]),
99 -
() => new ListBuilder<EvalResult>())
100 -
..addBuilderFactory(
101 -
const FullType(BuiltList, const [const FullType(EvaluationBatchRequest)]),
102 -
() => new ListBuilder<EvaluationBatchRequest>())
103 -
..addBuilderFactory(
104 -
const FullType(BuiltList, const [const FullType(EvaluationBatchResponse)]),
105 -
() => new ListBuilder<EvaluationBatchResponse>())
106 -
..addBuilderFactory(
107 -
const FullType(BuiltList, const [const FullType(EvaluationEntity)]),
108 -
() => new ListBuilder<EvaluationEntity>())
109 -
..addBuilderFactory(
110 -
const FullType(BuiltList, const [const FullType(Flag)]),
111 -
() => new ListBuilder<Flag>())
112 -
..addBuilderFactory(
113 -
const FullType(BuiltList, const [const FullType(FlagSnapshot)]),
114 -
() => new ListBuilder<FlagSnapshot>())
115 -
..addBuilderFactory(
116 -
const FullType(BuiltList, const [const FullType(Health)]),
117 -
() => new ListBuilder<Health>())
118 -
..addBuilderFactory(
119 -
const FullType(BuiltList, const [const FullType(PutDistributionsRequest)]),
120 -
() => new ListBuilder<PutDistributionsRequest>())
121 -
..addBuilderFactory(
122 -
const FullType(BuiltList, const [const FullType(PutFlagRequest)]),
123 -
() => new ListBuilder<PutFlagRequest>())
124 -
..addBuilderFactory(
125 -
const FullType(BuiltList, const [const FullType(PutSegmentReorderRequest)]),
126 -
() => new ListBuilder<PutSegmentReorderRequest>())
127 -
..addBuilderFactory(
128 -
const FullType(BuiltList, const [const FullType(PutSegmentRequest)]),
129 -
() => new ListBuilder<PutSegmentRequest>())
130 -
..addBuilderFactory(
131 -
const FullType(BuiltList, const [const FullType(PutVariantRequest)]),
132 -
() => new ListBuilder<PutVariantRequest>())
133 -
..addBuilderFactory(
134 -
const FullType(BuiltList, const [const FullType(Segment)]),
135 -
() => new ListBuilder<Segment>())
136 -
..addBuilderFactory(
137 -
const FullType(BuiltList, const [const FullType(SegmentDebugLog)]),
138 -
() => new ListBuilder<SegmentDebugLog>())
139 -
..addBuilderFactory(
140 -
const FullType(BuiltList, const [const FullType(SetFlagEnabledRequest)]),
141 -
() => new ListBuilder<SetFlagEnabledRequest>())
142 -
..addBuilderFactory(
143 -
const FullType(BuiltList, const [const FullType(Variant)]),
144 -
() => new ListBuilder<Variant>())
145 -
146 -
..add(Iso8601DateTimeSerializer())
147 -
).build();
68 +
      ..addBuilderFactory(
69 +
          const FullType(BuiltList, const [const FullType(Constraint)]),
70 +
          () => new ListBuilder<Constraint>())
71 +
      ..addBuilderFactory(
72 +
          const FullType(
73 +
              BuiltList, const [const FullType(CreateConstraintRequest)]),
74 +
          () => new ListBuilder<CreateConstraintRequest>())
75 +
      ..addBuilderFactory(
76 +
          const FullType(BuiltList, const [const FullType(CreateFlagRequest)]),
77 +
          () => new ListBuilder<CreateFlagRequest>())
78 +
      ..addBuilderFactory(
79 +
          const FullType(
80 +
              BuiltList, const [const FullType(CreateSegmentRequest)]),
81 +
          () => new ListBuilder<CreateSegmentRequest>())
82 +
      ..addBuilderFactory(
83 +
          const FullType(
84 +
              BuiltList, const [const FullType(CreateVariantRequest)]),
85 +
          () => new ListBuilder<CreateVariantRequest>())
86 +
      ..addBuilderFactory(
87 +
          const FullType(BuiltList, const [const FullType(Distribution)]),
88 +
          () => new ListBuilder<Distribution>())
89 +
      ..addBuilderFactory(
90 +
          const FullType(BuiltList, const [const FullType(Error)]),
91 +
          () => new ListBuilder<Error>())
92 +
      ..addBuilderFactory(
93 +
          const FullType(BuiltList, const [const FullType(EvalContext)]),
94 +
          () => new ListBuilder<EvalContext>())
95 +
      ..addBuilderFactory(
96 +
          const FullType(BuiltList, const [const FullType(EvalDebugLog)]),
97 +
          () => new ListBuilder<EvalDebugLog>())
98 +
      ..addBuilderFactory(
99 +
          const FullType(BuiltList, const [const FullType(EvalResult)]),
100 +
          () => new ListBuilder<EvalResult>())
101 +
      ..addBuilderFactory(
102 +
          const FullType(
103 +
              BuiltList, const [const FullType(EvaluationBatchRequest)]),
104 +
          () => new ListBuilder<EvaluationBatchRequest>())
105 +
      ..addBuilderFactory(
106 +
          const FullType(
107 +
              BuiltList, const [const FullType(EvaluationBatchResponse)]),
108 +
          () => new ListBuilder<EvaluationBatchResponse>())
109 +
      ..addBuilderFactory(
110 +
          const FullType(BuiltList, const [const FullType(EvaluationEntity)]),
111 +
          () => new ListBuilder<EvaluationEntity>())
112 +
      ..addBuilderFactory(
113 +
          const FullType(BuiltList, const [const FullType(Flag)]),
114 +
          () => new ListBuilder<Flag>())
115 +
      ..addBuilderFactory(
116 +
          const FullType(BuiltList, const [const FullType(FlagSnapshot)]),
117 +
          () => new ListBuilder<FlagSnapshot>())
118 +
      ..addBuilderFactory(
119 +
          const FullType(BuiltList, const [const FullType(Health)]),
120 +
          () => new ListBuilder<Health>())
121 +
      ..addBuilderFactory(
122 +
          const FullType(
123 +
              BuiltList, const [const FullType(PutDistributionsRequest)]),
124 +
          () => new ListBuilder<PutDistributionsRequest>())
125 +
      ..addBuilderFactory(
126 +
          const FullType(BuiltList, const [const FullType(PutFlagRequest)]),
127 +
          () => new ListBuilder<PutFlagRequest>())
128 +
      ..addBuilderFactory(
129 +
          const FullType(
130 +
              BuiltList, const [const FullType(PutSegmentReorderRequest)]),
131 +
          () => new ListBuilder<PutSegmentReorderRequest>())
132 +
      ..addBuilderFactory(
133 +
          const FullType(BuiltList, const [const FullType(PutSegmentRequest)]),
134 +
          () => new ListBuilder<PutSegmentRequest>())
135 +
      ..addBuilderFactory(
136 +
          const FullType(BuiltList, const [const FullType(PutVariantRequest)]),
137 +
          () => new ListBuilder<PutVariantRequest>())
138 +
      ..addBuilderFactory(
139 +
          const FullType(BuiltList, const [const FullType(Segment)]),
140 +
          () => new ListBuilder<Segment>())
141 +
      ..addBuilderFactory(
142 +
          const FullType(BuiltList, const [const FullType(SegmentDebugLog)]),
143 +
          () => new ListBuilder<SegmentDebugLog>())
144 +
      ..addBuilderFactory(
145 +
          const FullType(
146 +
              BuiltList, const [const FullType(SetFlagEnabledRequest)]),
147 +
          () => new ListBuilder<SetFlagEnabledRequest>())
148 +
      ..addBuilderFactory(
149 +
          const FullType(BuiltList, const [const FullType(Variant)]),
150 +
          () => new ListBuilder<Variant>())
151 +
      ..add(Iso8601DateTimeSerializer()))
152 +
    .build();
148 153
149 -
Serializers standardSerializers =
150 -
(serializers.toBuilder()
151 -
..add(OffsetDateSerializer())
152 -
..add(OffsetDateTimeSerializer())
153 -
..addPlugin(StandardJsonPlugin())).build();
154 +
Serializers standardSerializers = (serializers.toBuilder()
155 +
      ..add(OffsetDateSerializer())
156 +
      ..add(OffsetDateTimeSerializer())
157 +
      ..addPlugin(StandardJsonPlugin()))
158 +
    .build();

@@ -1,25 +1,24 @@
Loading
1 -
            import 'package:built_value/json_object.dart';
2 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:built_value/json_object.dart';
2 +
import 'package:built_value/built_value.dart';
3 3
import 'package:built_value/serializer.dart';
4 4
5 5
part 'create_variant_request.g.dart';
6 6
7 -
abstract class CreateVariantRequest implements Built<CreateVariantRequest, CreateVariantRequestBuilder> {
7 +
abstract class CreateVariantRequest
8 +
    implements Built<CreateVariantRequest, CreateVariantRequestBuilder> {
9 +
  @nullable
10 +
  @BuiltValueField(wireName: r'key')
11 +
  String get key;
8 12
9 -
    
10 -
        @nullable
11 -
    @BuiltValueField(wireName: r'key')
12 -
    String get key;
13 -
    
14 -
        @nullable
15 -
    @BuiltValueField(wireName: r'attachment')
16 -
    JsonObject get attachment;
13 +
  @nullable
14 +
  @BuiltValueField(wireName: r'attachment')
15 +
  JsonObject get attachment;
17 16
18 -
    // Boilerplate code needed to wire-up generated code
19 -
    CreateVariantRequest._();
20 -
21 -
    factory CreateVariantRequest([updates(CreateVariantRequestBuilder b)]) = _$CreateVariantRequest;
22 -
    static Serializer<CreateVariantRequest> get serializer => _$createVariantRequestSerializer;
17 +
  // Boilerplate code needed to wire-up generated code
18 +
  CreateVariantRequest._();
23 19
20 +
  factory CreateVariantRequest([updates(CreateVariantRequestBuilder b)]) =
21 +
      _$CreateVariantRequest;
22 +
  static Serializer<CreateVariantRequest> get serializer =>
23 +
      _$createVariantRequestSerializer;
24 24
}
25 -

@@ -1,28 +1,27 @@
Loading
1 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:built_value/built_value.dart';
2 2
import 'package:built_value/serializer.dart';
3 3
4 4
part 'create_constraint_request.g.dart';
5 5
6 -
abstract class CreateConstraintRequest implements Built<CreateConstraintRequest, CreateConstraintRequestBuilder> {
6 +
abstract class CreateConstraintRequest
7 +
    implements Built<CreateConstraintRequest, CreateConstraintRequestBuilder> {
8 +
  @nullable
9 +
  @BuiltValueField(wireName: r'property')
10 +
  String get property;
7 11
8 -
    
9 -
        @nullable
10 -
    @BuiltValueField(wireName: r'property')
11 -
    String get property;
12 -
    
13 -
        @nullable
14 -
    @BuiltValueField(wireName: r'operator')
15 -
    String get operator_;
16 -
    
17 -
        @nullable
18 -
    @BuiltValueField(wireName: r'value')
19 -
    String get value;
12 +
  @nullable
13 +
  @BuiltValueField(wireName: r'operator')
14 +
  String get operator_;
20 15
21 -
    // Boilerplate code needed to wire-up generated code
22 -
    CreateConstraintRequest._();
16 +
  @nullable
17 +
  @BuiltValueField(wireName: r'value')
18 +
  String get value;
23 19
24 -
    factory CreateConstraintRequest([updates(CreateConstraintRequestBuilder b)]) = _$CreateConstraintRequest;
25 -
    static Serializer<CreateConstraintRequest> get serializer => _$createConstraintRequestSerializer;
20 +
  // Boilerplate code needed to wire-up generated code
21 +
  CreateConstraintRequest._();
26 22
23 +
  factory CreateConstraintRequest([updates(CreateConstraintRequestBuilder b)]) =
24 +
      _$CreateConstraintRequest;
25 +
  static Serializer<CreateConstraintRequest> get serializer =>
26 +
      _$createConstraintRequestSerializer;
27 27
}
28 -

@@ -4,28 +4,30 @@
Loading
4 4
import 'package:dio/dio.dart';
5 5
6 6
class BasicAuthInfo {
7 -
    final String username;
8 -
    final String password;
7 +
  final String username;
8 +
  final String password;
9 9
10 -
    const BasicAuthInfo(this.username, this.password);
10 +
  const BasicAuthInfo(this.username, this.password);
11 11
}
12 12
13 13
class BasicAuthInterceptor extends AuthInterceptor {
14 -
    Map<String, BasicAuthInfo> authInfo = {};
14 +
  Map<String, BasicAuthInfo> authInfo = {};
15 15
16 -
    @override
17 -
    Future onRequest(RequestOptions options) {
18 -
        final metadataAuthInfo = getAuthInfo(options, 'basic');
19 -
        for (var info in metadataAuthInfo) {
20 -
            final authName = info['name'];
21 -
            final basicAuthInfo = authInfo[authName];
22 -
            if(basicAuthInfo != null) {
23 -
                String basicAuth = 'Basic ' + base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'));
24 -
                options.headers['Authorization'] = basicAuth;
25 -
                break;
26 -
            }
27 -
        }
28 -
29 -
        return super.onRequest(options);
16 +
  @override
17 +
  Future onRequest(RequestOptions options) {
18 +
    final metadataAuthInfo = getAuthInfo(options, 'basic');
19 +
    for (var info in metadataAuthInfo) {
20 +
      final authName = info['name'];
21 +
      final basicAuthInfo = authInfo[authName];
22 +
      if (basicAuthInfo != null) {
23 +
        String basicAuth = 'Basic ' +
24 +
            base64Encode(utf8
25 +
                .encode('${basicAuthInfo.username}:${basicAuthInfo.password}'));
26 +
        options.headers['Authorization'] = basicAuth;
27 +
        break;
28 +
      }
30 29
    }
30 +
31 +
    return super.onRequest(options);
32 +
  }
31 33
}

@@ -1,24 +1,23 @@
Loading
1 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:built_value/built_value.dart';
2 2
import 'package:built_value/serializer.dart';
3 3
4 4
part 'create_segment_request.g.dart';
5 5
6 -
abstract class CreateSegmentRequest implements Built<CreateSegmentRequest, CreateSegmentRequestBuilder> {
6 +
abstract class CreateSegmentRequest
7 +
    implements Built<CreateSegmentRequest, CreateSegmentRequestBuilder> {
8 +
  @nullable
9 +
  @BuiltValueField(wireName: r'description')
10 +
  String get description;
7 11
8 -
    
9 -
        @nullable
10 -
    @BuiltValueField(wireName: r'description')
11 -
    String get description;
12 -
    
13 -
        @nullable
14 -
    @BuiltValueField(wireName: r'rolloutPercent')
15 -
    int get rolloutPercent;
12 +
  @nullable
13 +
  @BuiltValueField(wireName: r'rolloutPercent')
14 +
  int get rolloutPercent;
16 15
17 -
    // Boilerplate code needed to wire-up generated code
18 -
    CreateSegmentRequest._();
19 -
20 -
    factory CreateSegmentRequest([updates(CreateSegmentRequestBuilder b)]) = _$CreateSegmentRequest;
21 -
    static Serializer<CreateSegmentRequest> get serializer => _$createSegmentRequestSerializer;
16 +
  // Boilerplate code needed to wire-up generated code
17 +
  CreateSegmentRequest._();
22 18
19 +
  factory CreateSegmentRequest([updates(CreateSegmentRequestBuilder b)]) =
20 +
      _$CreateSegmentRequest;
21 +
  static Serializer<CreateSegmentRequest> get serializer =>
22 +
      _$createSegmentRequestSerializer;
23 23
}
24 -

@@ -3,25 +3,25 @@
Loading
3 3
import 'package:dio/dio.dart';
4 4
5 5
class ApiKeyAuthInterceptor extends AuthInterceptor {
6 -
    Map<String, String> apiKeys = {};
6 +
  Map<String, String> apiKeys = {};
7 7
8 -
    @override
9 -
    Future onRequest(RequestOptions options) {
10 -
        final authInfo = getAuthInfo(options, "apiKey");
11 -
        for (var info in authInfo) {
12 -
            final authName = info["name"];
13 -
            final authKeyName = info["keyName"];
14 -
            final authWhere = info["where"];
15 -
            final apiKey = apiKeys[authName];
16 -
            if (apiKey != null) {
17 -
                if (authWhere == 'query') {
18 -
                    options.queryParameters[authKeyName] = apiKey;
19 -
                } else {
20 -
                    options.headers[authKeyName] = apiKey;
21 -
                }
22 -
                break;
23 -
            }
8 +
  @override
9 +
  Future onRequest(RequestOptions options) {
10 +
    final authInfo = getAuthInfo(options, "apiKey");
11 +
    for (var info in authInfo) {
12 +
      final authName = info["name"];
13 +
      final authKeyName = info["keyName"];
14 +
      final authWhere = info["where"];
15 +
      final apiKey = apiKeys[authName];
16 +
      if (apiKey != null) {
17 +
        if (authWhere == 'query') {
18 +
          options.queryParameters[authKeyName] = apiKey;
19 +
        } else {
20 +
          options.headers[authKeyName] = apiKey;
24 21
        }
25 -
        return super.onRequest(options);
22 +
        break;
23 +
      }
26 24
    }
25 +
    return super.onRequest(options);
26 +
  }
27 27
}

@@ -13,390 +13,448 @@
Loading
13 13
import 'package:flagr/model/flag_snapshot.dart';
14 14
15 15
class FlagApi {
16 -
    final Dio _dio;
17 -
    Serializers _serializers;
18 -
19 -
    FlagApi(this._dio, this._serializers);
20 -
21 -
        /// 
22 -
        ///
23 -
        /// 
24 -
        Future<Response<Flag>>createFlag(CreateFlagRequest body,{ CancelToken cancelToken, Map<String, String> headers,}) async {
25 -
26 -
        String _path = "/flags";
27 -
28 -
        Map<String, dynamic> queryParams = {};
29 -
        Map<String, String> headerParams = Map.from(headers ?? {});
30 -
        dynamic bodyData;
31 -
32 -
        queryParams.removeWhere((key, value) => value == null);
33 -
        headerParams.removeWhere((key, value) => value == null);
34 -
35 -
        List<String> contentTypes = ["application/json"];
36 -
37 -
38 -
            var serializedBody = _serializers.serialize(body);
39 -
            var jsonbody = json.encode(serializedBody);
40 -
            bodyData = jsonbody;
41 -
42 -
            return _dio.request(
43 -
            _path,
44 -
            queryParameters: queryParams,
45 -
            data: bodyData,
46 -
            options: Options(
47 -
            method: 'post'.toUpperCase(),
48 -
            headers: headerParams,
49 -
            extra: {
50 -
                'secure': [],
51 -
            },
52 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
53 -
            ),
54 -
            cancelToken: cancelToken,
55 -
            ).then((response) {
56 -
57 -
        var serializer = _serializers.serializerForType(Flag);
58 -
        var data = _serializers.deserializeWith<Flag>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
59 -
60 -
            return Response<Flag>(
61 -
                data: data,
62 -
                headers: response.headers,
63 -
                request: response.request,
64 -
                redirects: response.redirects,
65 -
                statusCode: response.statusCode,
66 -
                statusMessage: response.statusMessage,
67 -
                extra: response.extra,
68 -
            );
69 -
            });
70 -
            }
71 -
        /// 
72 -
        ///
73 -
        /// 
74 -
        Future<Response>deleteFlag(int flagID,{ CancelToken cancelToken, Map<String, String> headers,}) async {
75 -
76 -
        String _path = "/flags/{flagID}".replaceAll("{" r'flagID' "}", flagID.toString());
77 -
78 -
        Map<String, dynamic> queryParams = {};
79 -
        Map<String, String> headerParams = Map.from(headers ?? {});
80 -
        dynamic bodyData;
81 -
82 -
        queryParams.removeWhere((key, value) => value == null);
83 -
        headerParams.removeWhere((key, value) => value == null);
84 -
85 -
        List<String> contentTypes = [];
86 -
87 -
88 -
89 -
            return _dio.request(
90 -
            _path,
91 -
            queryParameters: queryParams,
92 -
            data: bodyData,
93 -
            options: Options(
94 -
            method: 'delete'.toUpperCase(),
95 -
            headers: headerParams,
96 -
            extra: {
97 -
                'secure': [],
98 -
            },
99 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
100 -
            ),
101 -
            cancelToken: cancelToken,
102 -
            );
103 -
            }
104 -
        /// 
105 -
        ///
106 -
        /// 
107 -
        Future<Response<List<Flag>>>findFlags({ int limit,bool enabled,String description,String descriptionLike,String key,int offset,bool preload,CancelToken cancelToken, Map<String, String> headers,}) async {
108 -
109 -
        String _path = "/flags";
110 -
111 -
        Map<String, dynamic> queryParams = {};
112 -
        Map<String, String> headerParams = Map.from(headers ?? {});
113 -
        dynamic bodyData;
114 -
115 -
                queryParams[r'limit'] = limit;
116 -
                queryParams[r'enabled'] = enabled;
117 -
                queryParams[r'description'] = description;
118 -
                queryParams[r'description_like'] = descriptionLike;
119 -
                queryParams[r'key'] = key;
120 -
                queryParams[r'offset'] = offset;
121 -
                queryParams[r'preload'] = preload;
122 -
        queryParams.removeWhere((key, value) => value == null);
123 -
        headerParams.removeWhere((key, value) => value == null);
124 -
125 -
        List<String> contentTypes = [];
126 -
127 -
128 -
129 -
            return _dio.request(
130 -
            _path,
131 -
            queryParameters: queryParams,
132 -
            data: bodyData,
133 -
            options: Options(
134 -
            method: 'get'.toUpperCase(),
135 -
            headers: headerParams,
136 -
            extra: {
137 -
                'secure': [],
138 -
            },
139 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
140 -
            ),
141 -
            cancelToken: cancelToken,
142 -
            ).then((response) {
143 -
144 -
                final FullType type = const FullType(BuiltList, const [const FullType(Flag)]);
145 -
                BuiltList<Flag> dataList = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
146 -
                var data = dataList.toList();
147 -
148 -
            return Response<List<Flag>>(
149 -
                data: data,
150 -
                headers: response.headers,
151 -
                request: response.request,
152 -
                redirects: response.redirects,
153 -
                statusCode: response.statusCode,
154 -
                statusMessage: response.statusMessage,
155 -
                extra: response.extra,
156 -
            );
157 -
            });
158 -
            }
159 -
        /// 
160 -
        ///
161 -
        /// 
162 -
        Future<Response<Flag>>getFlag(int flagID,{ CancelToken cancelToken, Map<String, String> headers,}) async {
163 -
164 -
        String _path = "/flags/{flagID}".replaceAll("{" r'flagID' "}", flagID.toString());
165 -
166 -
        Map<String, dynamic> queryParams = {};
167 -
        Map<String, String> headerParams = Map.from(headers ?? {});
168 -
        dynamic bodyData;
169 -
170 -
        queryParams.removeWhere((key, value) => value == null);
171 -
        headerParams.removeWhere((key, value) => value == null);
172 -
173 -
        List<String> contentTypes = [];
174 -
175 -
176 -
177 -
            return _dio.request(
178 -
            _path,
179 -
            queryParameters: queryParams,
180 -
            data: bodyData,
181 -
            options: Options(
182 -
            method: 'get'.toUpperCase(),
183 -
            headers: headerParams,
184 -
            extra: {
185 -
                'secure': [],
186 -
            },
187 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
188 -
            ),
189 -
            cancelToken: cancelToken,
190 -
            ).then((response) {
191 -
192 -
        var serializer = _serializers.serializerForType(Flag);
193 -
        var data = _serializers.deserializeWith<Flag>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
194 -
195 -
            return Response<Flag>(
196 -
                data: data,
197 -
                headers: response.headers,
198 -
                request: response.request,
199 -
                redirects: response.redirects,
200 -
                statusCode: response.statusCode,
201 -
                statusMessage: response.statusMessage,
202 -
                extra: response.extra,
203 -
            );
204 -
            });
205 -
            }
206 -
        /// 
207 -
        ///
208 -
        /// 
209 -
        Future<Response<List<String>>>getFlagEntityTypes({ CancelToken cancelToken, Map<String, String> headers,}) async {
210 -
211 -
        String _path = "/flags/entity_types";
212 -
213 -
        Map<String, dynamic> queryParams = {};
214 -
        Map<String, String> headerParams = Map.from(headers ?? {});
215 -
        dynamic bodyData;
216 -
217 -
        queryParams.removeWhere((key, value) => value == null);
218 -
        headerParams.removeWhere((key, value) => value == null);
219 -
220 -
        List<String> contentTypes = [];
221 -
222 -
223 -
224 -
            return _dio.request(
225 -
            _path,
226 -
            queryParameters: queryParams,
227 -
            data: bodyData,
228 -
            options: Options(
229 -
            method: 'get'.toUpperCase(),
230 -
            headers: headerParams,
231 -
            extra: {
232 -
                'secure': [],
233 -
            },
234 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
235 -
            ),
236 -
            cancelToken: cancelToken,
237 -
            ).then((response) {
238 -
239 -
                final FullType type = const FullType(BuiltList, const [const FullType(String)]);
240 -
                BuiltList<String> dataList = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
241 -
                var data = dataList.toList();
242 -
243 -
            return Response<List<String>>(
244 -
                data: data,
245 -
                headers: response.headers,
246 -
                request: response.request,
247 -
                redirects: response.redirects,
248 -
                statusCode: response.statusCode,
249 -
                statusMessage: response.statusMessage,
250 -
                extra: response.extra,
251 -
            );
252 -
            });
253 -
            }
254 -
        /// 
255 -
        ///
256 -
        /// 
257 -
        Future<Response<List<FlagSnapshot>>>getFlagSnapshots(int flagID,{ CancelToken cancelToken, Map<String, String> headers,}) async {
258 -
259 -
        String _path = "/flags/{flagID}/snapshots".replaceAll("{" r'flagID' "}", flagID.toString());
260 -
261 -
        Map<String, dynamic> queryParams = {};
262 -
        Map<String, String> headerParams = Map.from(headers ?? {});
263 -
        dynamic bodyData;
264 -
265 -
        queryParams.removeWhere((key, value) => value == null);
266 -
        headerParams.removeWhere((key, value) => value == null);
267 -
268 -
        List<String> contentTypes = [];
269 -
270 -
271 -
272 -
            return _dio.request(
273 -
            _path,
274 -
            queryParameters: queryParams,
275 -
            data: bodyData,
276 -
            options: Options(
277 -
            method: 'get'.toUpperCase(),
278 -
            headers: headerParams,
279 -
            extra: {
280 -
                'secure': [],
281 -
            },
282 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
283 -
            ),
284 -
            cancelToken: cancelToken,
285 -
            ).then((response) {
286 -
287 -
                final FullType type = const FullType(BuiltList, const [const FullType(FlagSnapshot)]);
288 -
                BuiltList<FlagSnapshot> dataList = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
289 -
                var data = dataList.toList();
290 -
291 -
            return Response<List<FlagSnapshot>>(
292 -
                data: data,
293 -
                headers: response.headers,
294 -
                request: response.request,
295 -
                redirects: response.redirects,
296 -
                statusCode: response.statusCode,
297 -
                statusMessage: response.statusMessage,
298 -
                extra: response.extra,
299 -
            );
300 -
            });
301 -
            }
302 -
        /// 
303 -
        ///
304 -
        /// 
305 -
        Future<Response<Flag>>putFlag(int flagID,PutFlagRequest body,{ CancelToken cancelToken, Map<String, String> headers,}) async {
306 -
307 -
        String _path = "/flags/{flagID}".replaceAll("{" r'flagID' "}", flagID.toString());
308 -
309 -
        Map<String, dynamic> queryParams = {};
310 -
        Map<String, String> headerParams = Map.from(headers ?? {});
311 -
        dynamic bodyData;
312 -
313 -
        queryParams.removeWhere((key, value) => value == null);
314 -
        headerParams.removeWhere((key, value) => value == null);
315 -
316 -
        List<String> contentTypes = ["application/json"];
317 -
318 -
319 -
            var serializedBody = _serializers.serialize(body);
320 -
            var jsonbody = json.encode(serializedBody);
321 -
            bodyData = jsonbody;
322 -
323 -
            return _dio.request(
324 -
            _path,
325 -
            queryParameters: queryParams,
326 -
            data: bodyData,
327 -
            options: Options(
328 -
            method: 'put'.toUpperCase(),
329 -
            headers: headerParams,
330 -
            extra: {
331 -
                'secure': [],
332 -
            },
333 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
334 -
            ),
335 -
            cancelToken: cancelToken,
336 -
            ).then((response) {
337 -
338 -
        var serializer = _serializers.serializerForType(Flag);
339 -
        var data = _serializers.deserializeWith<Flag>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
340 -
341 -
            return Response<Flag>(
342 -
                data: data,
343 -
                headers: response.headers,
344 -
                request: response.request,
345 -
                redirects: response.redirects,
346 -
                statusCode: response.statusCode,
347 -
                statusMessage: response.statusMessage,
348 -
                extra: response.extra,
349 -
            );
350 -
            });
351 -
            }
352 -
        /// 
353 -
        ///
354 -
        /// 
355 -
        Future<Response<Flag>>setFlagEnabled(int flagID,SetFlagEnabledRequest body,{ CancelToken cancelToken, Map<String, String> headers,}) async {
356 -
357 -
        String _path = "/flags/{flagID}/enabled".replaceAll("{" r'flagID' "}", flagID.toString());
358 -
359 -
        Map<String, dynamic> queryParams = {};
360 -
        Map<String, String> headerParams = Map.from(headers ?? {});
361 -
        dynamic bodyData;
362 -
363 -
        queryParams.removeWhere((key, value) => value == null);
364 -
        headerParams.removeWhere((key, value) => value == null);
365 -
366 -
        List<String> contentTypes = ["application/json"];
367 -
368 -
369 -
            var serializedBody = _serializers.serialize(body);
370 -
            var jsonbody = json.encode(serializedBody);
371 -
            bodyData = jsonbody;
372 -
373 -
            return _dio.request(
374 -
            _path,
375 -
            queryParameters: queryParams,
376 -
            data: bodyData,
377 -
            options: Options(
378 -
            method: 'put'.toUpperCase(),
379 -
            headers: headerParams,
380 -
            extra: {
381 -
                'secure': [],
382 -
            },
383 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
384 -
            ),
385 -
            cancelToken: cancelToken,
386 -
            ).then((response) {
387 -
388 -
        var serializer = _serializers.serializerForType(Flag);
389 -
        var data = _serializers.deserializeWith<Flag>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
390 -
391 -
            return Response<Flag>(
392 -
                data: data,
393 -
                headers: response.headers,
394 -
                request: response.request,
395 -
                redirects: response.redirects,
396 -
                statusCode: response.statusCode,
397 -
                statusMessage: response.statusMessage,
398 -
                extra: response.extra,
399 -
            );
400 -
            });
401 -
            }
402 -
        }
16 +
  final Dio _dio;
17 +
  Serializers _serializers;
18 +
19 +
  FlagApi(this._dio, this._serializers);
20 +
21 +
  ///
22 +
  ///
23 +
  ///
24 +
  Future<Response<Flag>> createFlag(
25 +
    CreateFlagRequest body, {
26 +
    CancelToken cancelToken,
27 +
    Map<String, String> headers,
28 +
  }) async {
29 +
    String _path = "/flags";
30 +
31 +
    Map<String, dynamic> queryParams = {};
32 +
    Map<String, String> headerParams = Map.from(headers ?? {});
33 +
    dynamic bodyData;
34 +
35 +
    queryParams.removeWhere((key, value) => value == null);
36 +
    headerParams.removeWhere((key, value) => value == null);
37 +
38 +
    List<String> contentTypes = ["application/json"];
39 +
40 +
    var serializedBody = _serializers.serialize(body);
41 +
    var jsonbody = json.encode(serializedBody);
42 +
    bodyData = jsonbody;
43 +
44 +
    return _dio
45 +
        .request(
46 +
      _path,
47 +
      queryParameters: queryParams,
48 +
      data: bodyData,
49 +
      options: Options(
50 +
        method: 'post'.toUpperCase(),
51 +
        headers: headerParams,
52 +
        extra: {
53 +
          'secure': [],
54 +
        },
55 +
        contentType:
56 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
57 +
      ),
58 +
      cancelToken: cancelToken,
59 +
    )
60 +
        .then((response) {
61 +
      var serializer = _serializers.serializerForType(Flag);
62 +
      var data = _serializers.deserializeWith<Flag>(serializer,
63 +
          response.data is String ? jsonDecode(response.data) : response.data);
64 +
65 +
      return Response<Flag>(
66 +
        data: data,
67 +
        headers: response.headers,
68 +
        request: response.request,
69 +
        redirects: response.redirects,
70 +
        statusCode: response.statusCode,
71 +
        statusMessage: response.statusMessage,
72 +
        extra: response.extra,
73 +
      );
74 +
    });
75 +
  }
76 +
77 +
  ///
78 +
  ///
79 +
  ///
80 +
  Future<Response> deleteFlag(
81 +
    int flagID, {
82 +
    CancelToken cancelToken,
83 +
    Map<String, String> headers,
84 +
  }) async {
85 +
    String _path =
86 +
        "/flags/{flagID}".replaceAll("{" r'flagID' "}", flagID.toString());
87 +
88 +
    Map<String, dynamic> queryParams = {};
89 +
    Map<String, String> headerParams = Map.from(headers ?? {});
90 +
    dynamic bodyData;
91 +
92 +
    queryParams.removeWhere((key, value) => value == null);
93 +
    headerParams.removeWhere((key, value) => value == null);
94 +
95 +
    List<String> contentTypes = [];
96 +
97 +
    return _dio.request(
98 +
      _path,
99 +
      queryParameters: queryParams,
100 +
      data: bodyData,
101 +
      options: Options(
102 +
        method: 'delete'.toUpperCase(),
103 +
        headers: headerParams,
104 +
        extra: {
105 +
          'secure': [],
106 +
        },
107 +
        contentType:
108 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
109 +
      ),
110 +
      cancelToken: cancelToken,
111 +
    );
112 +
  }
113 +
114 +
  ///
115 +
  ///
116 +
  ///
117 +
  Future<Response<List<Flag>>> findFlags({
118 +
    int limit,
119 +
    bool enabled,
120 +
    String description,
121 +
    String descriptionLike,
122 +
    String key,
123 +
    int offset,
124 +
    bool preload,
125 +
    CancelToken cancelToken,
126 +
    Map<String, String> headers,
127 +
  }) async {
128 +
    String _path = "/flags";
129 +
130 +
    Map<String, dynamic> queryParams = {};
131 +
    Map<String, String> headerParams = Map.from(headers ?? {});
132 +
    dynamic bodyData;
133 +
134 +
    queryParams[r'limit'] = limit;
135 +
    queryParams[r'enabled'] = enabled;
136 +
    queryParams[r'description'] = description;
137 +
    queryParams[r'description_like'] = descriptionLike;
138 +
    queryParams[r'key'] = key;
139 +
    queryParams[r'offset'] = offset;
140 +
    queryParams[r'preload'] = preload;
141 +
    queryParams.removeWhere((key, value) => value == null);
142 +
    headerParams.removeWhere((key, value) => value == null);
143 +
144 +
    List<String> contentTypes = [];
145 +
146 +
    return _dio
147 +
        .request(
148 +
      _path,
149 +
      queryParameters: queryParams,
150 +
      data: bodyData,
151 +
      options: Options(
152 +
        method: 'get'.toUpperCase(),
153 +
        headers: headerParams,
154 +
        extra: {
155 +
          'secure': [],
156 +
        },
157 +
        contentType:
158 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
159 +
      ),
160 +
      cancelToken: cancelToken,
161 +
    )
162 +
        .then((response) {
163 +
      final FullType type =
164 +
          const FullType(BuiltList, const [const FullType(Flag)]);
165 +
      BuiltList<Flag> dataList = _serializers.deserialize(
166 +
          response.data is String ? jsonDecode(response.data) : response.data,
167 +
          specifiedType: type);
168 +
      var data = dataList.toList();
169 +
170 +
      return Response<List<Flag>>(
171 +
        data: data,
172 +
        headers: response.headers,
173 +
        request: response.request,
174 +
        redirects: response.redirects,
175 +
        statusCode: response.statusCode,
176 +
        statusMessage: response.statusMessage,
177 +
        extra: response.extra,
178 +
      );
179 +
    });
180 +
  }
181 +
182 +
  ///
183 +
  ///
184 +
  ///
185 +
  Future<Response<Flag>> getFlag(
186 +
    int flagID, {
187 +
    CancelToken cancelToken,
188 +
    Map<String, String> headers,
189 +
  }) async {
190 +
    String _path =
191 +
        "/flags/{flagID}".replaceAll("{" r'flagID' "}", flagID.toString());
192 +
193 +
    Map<String, dynamic> queryParams = {};
194 +
    Map<String, String> headerParams = Map.from(headers ?? {});
195 +
    dynamic bodyData;
196 +
197 +
    queryParams.removeWhere((key, value) => value == null);
198 +
    headerParams.removeWhere((key, value) => value == null);
199 +
200 +
    List<String> contentTypes = [];
201 +
202 +
    return _dio
203 +
        .request(
204 +
      _path,
205 +
      queryParameters: queryParams,
206 +
      data: bodyData,
207 +
      options: Options(
208 +
        method: 'get'.toUpperCase(),
209 +
        headers: headerParams,
210 +
        extra: {
211 +
          'secure': [],
212 +
        },
213 +
        contentType:
214 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
215 +
      ),
216 +
      cancelToken: cancelToken,
217 +
    )
218 +
        .then((response) {
219 +
      var serializer = _serializers.serializerForType(Flag);
220 +
      var data = _serializers.deserializeWith<Flag>(serializer,
221 +
          response.data is String ? jsonDecode(response.data) : response.data);
222 +
223 +
      return Response<Flag>(
224 +
        data: data,
225 +
        headers: response.headers,
226 +
        request: response.request,
227 +
        redirects: response.redirects,
228 +
        statusCode: response.statusCode,
229 +
        statusMessage: response.statusMessage,
230 +
        extra: response.extra,
231 +
      );
232 +
    });
233 +
  }
234 +
235 +
  ///
236 +
  ///
237 +
  ///
238 +
  Future<Response<List<String>>> getFlagEntityTypes({
239 +
    CancelToken cancelToken,
240 +
    Map<String, String> headers,
241 +
  }) async {
242 +
    String _path = "/flags/entity_types";
243 +
244 +
    Map<String, dynamic> queryParams = {};
245 +
    Map<String, String> headerParams = Map.from(headers ?? {});
246 +
    dynamic bodyData;
247 +
248 +
    queryParams.removeWhere((key, value) => value == null);
249 +
    headerParams.removeWhere((key, value) => value == null);
250 +
251 +
    List<String> contentTypes = [];
252 +
253 +
    return _dio
254 +
        .request(
255 +
      _path,
256 +
      queryParameters: queryParams,
257 +
      data: bodyData,
258 +
      options: Options(
259 +
        method: 'get'.toUpperCase(),
260 +
        headers: headerParams,
261 +
        extra: {
262 +
          'secure': [],
263 +
        },
264 +
        contentType:
265 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
266 +
      ),
267 +
      cancelToken: cancelToken,
268 +
    )
269 +
        .then((response) {
270 +
      final FullType type =
271 +
          const FullType(BuiltList, const [const FullType(String)]);
272 +
      BuiltList<String> dataList = _serializers.deserialize(
273 +
          response.data is String ? jsonDecode(response.data) : response.data,
274 +
          specifiedType: type);
275 +
      var data = dataList.toList();
276 +
277 +
      return Response<List<String>>(
278 +
        data: data,
279 +
        headers: response.headers,
280 +
        request: response.request,
281 +
        redirects: response.redirects,
282 +
        statusCode: response.statusCode,
283 +
        statusMessage: response.statusMessage,
284 +
        extra: response.extra,
285 +
      );
286 +
    });
287 +
  }
288 +
289 +
  ///
290 +
  ///
291 +
  ///
292 +
  Future<Response<List<FlagSnapshot>>> getFlagSnapshots(
293 +
    int flagID, {
294 +
    CancelToken cancelToken,
295 +
    Map<String, String> headers,
296 +
  }) async {
297 +
    String _path = "/flags/{flagID}/snapshots"
298 +
        .replaceAll("{" r'flagID' "}", flagID.toString());
299 +
300 +
    Map<String, dynamic> queryParams = {};
301 +
    Map<String, String> headerParams = Map.from(headers ?? {});
302 +
    dynamic bodyData;
303 +
304 +
    queryParams.removeWhere((key, value) => value == null);
305 +
    headerParams.removeWhere((key, value) => value == null);
306 +
307 +
    List<String> contentTypes = [];
308 +
309 +
    return _dio
310 +
        .request(
311 +
      _path,
312 +
      queryParameters: queryParams,
313 +
      data: bodyData,
314 +
      options: Options(
315 +
        method: 'get'.toUpperCase(),
316 +
        headers: headerParams,
317 +
        extra: {
318 +
          'secure': [],
319 +
        },
320 +
        contentType:
321 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
322 +
      ),
323 +
      cancelToken: cancelToken,
324 +
    )
325 +
        .then((response) {
326 +
      final FullType type =
327 +
          const FullType(BuiltList, const [const FullType(FlagSnapshot)]);
328 +
      BuiltList<FlagSnapshot> dataList = _serializers.deserialize(
329 +
          response.data is String ? jsonDecode(response.data) : response.data,
330 +
          specifiedType: type);
331 +
      var data = dataList.toList();
332 +
333 +
      return Response<List<FlagSnapshot>>(
334 +
        data: data,
335 +
        headers: response.headers,
336 +
        request: response.request,
337 +
        redirects: response.redirects,
338 +
        statusCode: response.statusCode,
339 +
        statusMessage: response.statusMessage,
340 +
        extra: response.extra,
341 +
      );
342 +
    });
343 +
  }
344 +
345 +
  ///
346 +
  ///
347 +
  ///
348 +
  Future<Response<Flag>> putFlag(
349 +
    int flagID,
350 +
    PutFlagRequest body, {
351 +
    CancelToken cancelToken,
352 +
    Map<String, String> headers,
353 +
  }) async {
354 +
    String _path =
355 +
        "/flags/{flagID}".replaceAll("{" r'flagID' "}", flagID.toString());
356 +
357 +
    Map<String, dynamic> queryParams = {};
358 +
    Map<String, String> headerParams = Map.from(headers ?? {});
359 +
    dynamic bodyData;
360 +
361 +
    queryParams.removeWhere((key, value) => value == null);
362 +
    headerParams.removeWhere((key, value) => value == null);
363 +
364 +
    List<String> contentTypes = ["application/json"];
365 +
366 +
    var serializedBody = _serializers.serialize(body);
367 +
    var jsonbody = json.encode(serializedBody);
368 +
    bodyData = jsonbody;
369 +
370 +
    return _dio
371 +
        .request(
372 +
      _path,
373 +
      queryParameters: queryParams,
374 +
      data: bodyData,
375 +
      options: Options(
376 +
        method: 'put'.toUpperCase(),
377 +
        headers: headerParams,
378 +
        extra: {
379 +
          'secure': [],
380 +
        },
381 +
        contentType:
382 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
383 +
      ),
384 +
      cancelToken: cancelToken,
385 +
    )
386 +
        .then((response) {
387 +
      var serializer = _serializers.serializerForType(Flag);
388 +
      var data = _serializers.deserializeWith<Flag>(serializer,
389 +
          response.data is String ? jsonDecode(response.data) : response.data);
390 +
391 +
      return Response<Flag>(
392 +
        data: data,
393 +
        headers: response.headers,
394 +
        request: response.request,
395 +
        redirects: response.redirects,
396 +
        statusCode: response.statusCode,
397 +
        statusMessage: response.statusMessage,
398 +
        extra: response.extra,
399 +
      );
400 +
    });
401 +
  }
402 +
403 +
  ///
404 +
  ///
405 +
  ///
406 +
  Future<Response<Flag>> setFlagEnabled(
407 +
    int flagID,
408 +
    SetFlagEnabledRequest body, {
409 +
    CancelToken cancelToken,
410 +
    Map<String, String> headers,
411 +
  }) async {
412 +
    String _path = "/flags/{flagID}/enabled"
413 +
        .replaceAll("{" r'flagID' "}", flagID.toString());
414 +
415 +
    Map<String, dynamic> queryParams = {};
416 +
    Map<String, String> headerParams = Map.from(headers ?? {});
417 +
    dynamic bodyData;
418 +
419 +
    queryParams.removeWhere((key, value) => value == null);
420 +
    headerParams.removeWhere((key, value) => value == null);
421 +
422 +
    List<String> contentTypes = ["application/json"];
423 +
424 +
    var serializedBody = _serializers.serialize(body);
425 +
    var jsonbody = json.encode(serializedBody);
426 +
    bodyData = jsonbody;
427 +
428 +
    return _dio
429 +
        .request(
430 +
      _path,
431 +
      queryParameters: queryParams,
432 +
      data: bodyData,
433 +
      options: Options(
434 +
        method: 'put'.toUpperCase(),
435 +
        headers: headerParams,
436 +
        extra: {
437 +
          'secure': [],
438 +
        },
439 +
        contentType:
440 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
441 +
      ),
442 +
      cancelToken: cancelToken,
443 +
    )
444 +
        .then((response) {
445 +
      var serializer = _serializers.serializerForType(Flag);
446 +
      var data = _serializers.deserializeWith<Flag>(serializer,
447 +
          response.data is String ? jsonDecode(response.data) : response.data);
448 +
449 +
      return Response<Flag>(
450 +
        data: data,
451 +
        headers: response.headers,
452 +
        request: response.request,
453 +
        redirects: response.redirects,
454 +
        statusCode: response.statusCode,
455 +
        statusMessage: response.statusMessage,
456 +
        extra: response.extra,
457 +
      );
458 +
    });
459 +
  }
460 +
}

@@ -1,28 +1,27 @@
Loading
1 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:built_value/built_value.dart';
2 2
import 'package:built_value/serializer.dart';
3 3
4 4
part 'create_flag_request.g.dart';
5 5
6 -
abstract class CreateFlagRequest implements Built<CreateFlagRequest, CreateFlagRequestBuilder> {
6 +
abstract class CreateFlagRequest
7 +
    implements Built<CreateFlagRequest, CreateFlagRequestBuilder> {
8 +
  @nullable
9 +
  @BuiltValueField(wireName: r'description')
10 +
  String get description;
11 +
  /* unique key representation of the flag */
12 +
  @nullable
13 +
  @BuiltValueField(wireName: r'key')
14 +
  String get key;
15 +
  /* template for flag creation */
16 +
  @nullable
17 +
  @BuiltValueField(wireName: r'template')
18 +
  String get template;
7 19
8 -
    
9 -
        @nullable
10 -
    @BuiltValueField(wireName: r'description')
11 -
    String get description;
12 -
    /* unique key representation of the flag */
13 -
        @nullable
14 -
    @BuiltValueField(wireName: r'key')
15 -
    String get key;
16 -
    /* template for flag creation */
17 -
        @nullable
18 -
    @BuiltValueField(wireName: r'template')
19 -
    String get template;
20 -
21 -
    // Boilerplate code needed to wire-up generated code
22 -
    CreateFlagRequest._();
23 -
24 -
    factory CreateFlagRequest([updates(CreateFlagRequestBuilder b)]) = _$CreateFlagRequest;
25 -
    static Serializer<CreateFlagRequest> get serializer => _$createFlagRequestSerializer;
20 +
  // Boilerplate code needed to wire-up generated code
21 +
  CreateFlagRequest._();
26 22
23 +
  factory CreateFlagRequest([updates(CreateFlagRequestBuilder b)]) =
24 +
      _$CreateFlagRequest;
25 +
  static Serializer<CreateFlagRequest> get serializer =>
26 +
      _$createFlagRequestSerializer;
27 27
}
28 -

@@ -10,190 +10,231 @@
Loading
10 10
import 'package:flagr/model/error.dart';
11 11
12 12
class ConstraintApi {
13 -
    final Dio _dio;
14 -
    Serializers _serializers;
15 -
16 -
    ConstraintApi(this._dio, this._serializers);
17 -
18 -
        /// 
19 -
        ///
20 -
        /// 
21 -
        Future<Response<Constraint>>createConstraint(int flagID,int segmentID,CreateConstraintRequest body,{ CancelToken cancelToken, Map<String, String> headers,}) async {
22 -
23 -
        String _path = "/flags/{flagID}/segments/{segmentID}/constraints".replaceAll("{" r'flagID' "}", flagID.toString()).replaceAll("{" r'segmentID' "}", segmentID.toString());
24 -
25 -
        Map<String, dynamic> queryParams = {};
26 -
        Map<String, String> headerParams = Map.from(headers ?? {});
27 -
        dynamic bodyData;
28 -
29 -
        queryParams.removeWhere((key, value) => value == null);
30 -
        headerParams.removeWhere((key, value) => value == null);
31 -
32 -
        List<String> contentTypes = ["application/json"];
33 -
34 -
35 -
            var serializedBody = _serializers.serialize(body);
36 -
            var jsonbody = json.encode(serializedBody);
37 -
            bodyData = jsonbody;
38 -
39 -
            return _dio.request(
40 -
            _path,
41 -
            queryParameters: queryParams,
42 -
            data: bodyData,
43 -
            options: Options(
44 -
            method: 'post'.toUpperCase(),
45 -
            headers: headerParams,
46 -
            extra: {
47 -
                'secure': [],
48 -
            },
49 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
50 -
            ),
51 -
            cancelToken: cancelToken,
52 -
            ).then((response) {
53 -
54 -
        var serializer = _serializers.serializerForType(Constraint);
55 -
        var data = _serializers.deserializeWith<Constraint>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
56 -
57 -
            return Response<Constraint>(
58 -
                data: data,
59 -
                headers: response.headers,
60 -
                request: response.request,
61 -
                redirects: response.redirects,
62 -
                statusCode: response.statusCode,
63 -
                statusMessage: response.statusMessage,
64 -
                extra: response.extra,
65 -
            );
66 -
            });
67 -
            }
68 -
        /// 
69 -
        ///
70 -
        /// 
71 -
        Future<Response>deleteConstraint(int flagID,int segmentID,int constraintID,{ CancelToken cancelToken, Map<String, String> headers,}) async {
72 -
73 -
        String _path = "/flags/{flagID}/segments/{segmentID}/constraints/{constraintID}".replaceAll("{" r'flagID' "}", flagID.toString()).replaceAll("{" r'segmentID' "}", segmentID.toString()).replaceAll("{" r'constraintID' "}", constraintID.toString());
74 -
75 -
        Map<String, dynamic> queryParams = {};
76 -
        Map<String, String> headerParams = Map.from(headers ?? {});
77 -
        dynamic bodyData;
78 -
79 -
        queryParams.removeWhere((key, value) => value == null);
80 -
        headerParams.removeWhere((key, value) => value == null);
81 -
82 -
        List<String> contentTypes = [];
83 -
84 -
85 -
86 -
            return _dio.request(
87 -
            _path,
88 -
            queryParameters: queryParams,
89 -
            data: bodyData,
90 -
            options: Options(
91 -
            method: 'delete'.toUpperCase(),
92 -
            headers: headerParams,
93 -
            extra: {
94 -
                'secure': [],
95 -
            },
96 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
97 -
            ),
98 -
            cancelToken: cancelToken,
99 -
            );
100 -
            }
101 -
        /// 
102 -
        ///
103 -
        /// 
104 -
        Future<Response<List<Constraint>>>findConstraints(int flagID,int segmentID,{ CancelToken cancelToken, Map<String, String> headers,}) async {
105 -
106 -
        String _path = "/flags/{flagID}/segments/{segmentID}/constraints".replaceAll("{" r'flagID' "}", flagID.toString()).replaceAll("{" r'segmentID' "}", segmentID.toString());
107 -
108 -
        Map<String, dynamic> queryParams = {};
109 -
        Map<String, String> headerParams = Map.from(headers ?? {});
110 -
        dynamic bodyData;
111 -
112 -
        queryParams.removeWhere((key, value) => value == null);
113 -
        headerParams.removeWhere((key, value) => value == null);
114 -
115 -
        List<String> contentTypes = [];
116 -
117 -
118 -
119 -
            return _dio.request(
120 -
            _path,
121 -
            queryParameters: queryParams,
122 -
            data: bodyData,
123 -
            options: Options(
124 -
            method: 'get'.toUpperCase(),
125 -
            headers: headerParams,
126 -
            extra: {
127 -
                'secure': [],
128 -
            },
129 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
130 -
            ),
131 -
            cancelToken: cancelToken,
132 -
            ).then((response) {
133 -
134 -
                final FullType type = const FullType(BuiltList, const [const FullType(Constraint)]);
135 -
                BuiltList<Constraint> dataList = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
136 -
                var data = dataList.toList();
137 -
138 -
            return Response<List<Constraint>>(
139 -
                data: data,
140 -
                headers: response.headers,
141 -
                request: response.request,
142 -
                redirects: response.redirects,
143 -
                statusCode: response.statusCode,
144 -
                statusMessage: response.statusMessage,
145 -
                extra: response.extra,
146 -
            );
147 -
            });
148 -
            }
149 -
        /// 
150 -
        ///
151 -
        /// 
152 -
        Future<Response<Constraint>>putConstraint(int flagID,int segmentID,int constraintID,CreateConstraintRequest body,{ CancelToken cancelToken, Map<String, String> headers,}) async {
153 -
154 -
        String _path = "/flags/{flagID}/segments/{segmentID}/constraints/{constraintID}".replaceAll("{" r'flagID' "}", flagID.toString()).replaceAll("{" r'segmentID' "}", segmentID.toString()).replaceAll("{" r'constraintID' "}", constraintID.toString());
155 -
156 -
        Map<String, dynamic> queryParams = {};
157 -
        Map<String, String> headerParams = Map.from(headers ?? {});
158 -
        dynamic bodyData;
159 -
160 -
        queryParams.removeWhere((key, value) => value == null);
161 -
        headerParams.removeWhere((key, value) => value == null);
162 -
163 -
        List<String> contentTypes = ["application/json"];
164 -
165 -
166 -
            var serializedBody = _serializers.serialize(body);
167 -
            var jsonbody = json.encode(serializedBody);
168 -
            bodyData = jsonbody;
169 -
170 -
            return _dio.request(
171 -
            _path,
172 -
            queryParameters: queryParams,
173 -
            data: bodyData,
174 -
            options: Options(
175 -
            method: 'put'.toUpperCase(),
176 -
            headers: headerParams,
177 -
            extra: {
178 -
                'secure': [],
179 -
            },
180 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
181 -
            ),
182 -
            cancelToken: cancelToken,
183 -
            ).then((response) {
184 -
185 -
        var serializer = _serializers.serializerForType(Constraint);
186 -
        var data = _serializers.deserializeWith<Constraint>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
187 -
188 -
            return Response<Constraint>(
189 -
                data: data,
190 -
                headers: response.headers,
191 -
                request: response.request,
192 -
                redirects: response.redirects,
193 -
                statusCode: response.statusCode,
194 -
                statusMessage: response.statusMessage,
195 -
                extra: response.extra,
196 -
            );
197 -
            });
198 -
            }
199 -
        }
13 +
  final Dio _dio;
14 +
  Serializers _serializers;
15 +
16 +
  ConstraintApi(this._dio, this._serializers);
17 +
18 +
  ///
19 +
  ///
20 +
  ///
21 +
  Future<Response<Constraint>> createConstraint(
22 +
    int flagID,
23 +
    int segmentID,
24 +
    CreateConstraintRequest body, {
25 +
    CancelToken cancelToken,
26 +
    Map<String, String> headers,
27 +
  }) async {
28 +
    String _path = "/flags/{flagID}/segments/{segmentID}/constraints"
29 +
        .replaceAll("{" r'flagID' "}", flagID.toString())
30 +
        .replaceAll("{" r'segmentID' "}", segmentID.toString());
31 +
32 +
    Map<String, dynamic> queryParams = {};
33 +
    Map<String, String> headerParams = Map.from(headers ?? {});
34 +
    dynamic bodyData;
35 +
36 +
    queryParams.removeWhere((key, value) => value == null);
37 +
    headerParams.removeWhere((key, value) => value == null);
38 +
39 +
    List<String> contentTypes = ["application/json"];
40 +
41 +
    var serializedBody = _serializers.serialize(body);
42 +
    var jsonbody = json.encode(serializedBody);
43 +
    bodyData = jsonbody;
44 +
45 +
    return _dio
46 +
        .request(
47 +
      _path,
48 +
      queryParameters: queryParams,
49 +
      data: bodyData,
50 +
      options: Options(
51 +
        method: 'post'.toUpperCase(),
52 +
        headers: headerParams,
53 +
        extra: {
54 +
          'secure': [],
55 +
        },
56 +
        contentType:
57 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
58 +
      ),
59 +
      cancelToken: cancelToken,
60 +
    )
61 +
        .then((response) {
62 +
      var serializer = _serializers.serializerForType(Constraint);
63 +
      var data = _serializers.deserializeWith<Constraint>(serializer,
64 +
          response.data is String ? jsonDecode(response.data) : response.data);
65 +
66 +
      return Response<Constraint>(
67 +
        data: data,
68 +
        headers: response.headers,
69 +
        request: response.request,
70 +
        redirects: response.redirects,
71 +
        statusCode: response.statusCode,
72 +
        statusMessage: response.statusMessage,
73 +
        extra: response.extra,
74 +
      );
75 +
    });
76 +
  }
77 +
78 +
  ///
79 +
  ///
80 +
  ///
81 +
  Future<Response> deleteConstraint(
82 +
    int flagID,
83 +
    int segmentID,
84 +
    int constraintID, {
85 +
    CancelToken cancelToken,
86 +
    Map<String, String> headers,
87 +
  }) async {
88 +
    String _path =
89 +
        "/flags/{flagID}/segments/{segmentID}/constraints/{constraintID}"
90 +
            .replaceAll("{" r'flagID' "}", flagID.toString())
91 +
            .replaceAll("{" r'segmentID' "}", segmentID.toString())
92 +
            .replaceAll("{" r'constraintID' "}", constraintID.toString());
93 +
94 +
    Map<String, dynamic> queryParams = {};
95 +
    Map<String, String> headerParams = Map.from(headers ?? {});
96 +
    dynamic bodyData;
97 +
98 +
    queryParams.removeWhere((key, value) => value == null);
99 +
    headerParams.removeWhere((key, value) => value == null);
100 +
101 +
    List<String> contentTypes = [];
102 +
103 +
    return _dio.request(
104 +
      _path,
105 +
      queryParameters: queryParams,
106 +
      data: bodyData,
107 +
      options: Options(
108 +
        method: 'delete'.toUpperCase(),
109 +
        headers: headerParams,
110 +
        extra: {
111 +
          'secure': [],
112 +
        },
113 +
        contentType:
114 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
115 +
      ),
116 +
      cancelToken: cancelToken,
117 +
    );
118 +
  }
119 +
120 +
  ///
121 +
  ///
122 +
  ///
123 +
  Future<Response<List<Constraint>>> findConstraints(
124 +
    int flagID,
125 +
    int segmentID, {
126 +
    CancelToken cancelToken,
127 +
    Map<String, String> headers,
128 +
  }) async {
129 +
    String _path = "/flags/{flagID}/segments/{segmentID}/constraints"
130 +
        .replaceAll("{" r'flagID' "}", flagID.toString())
131 +
        .replaceAll("{" r'segmentID' "}", segmentID.toString());
132 +
133 +
    Map<String, dynamic> queryParams = {};
134 +
    Map<String, String> headerParams = Map.from(headers ?? {});
135 +
    dynamic bodyData;
136 +
137 +
    queryParams.removeWhere((key, value) => value == null);
138 +
    headerParams.removeWhere((key, value) => value == null);
139 +
140 +
    List<String> contentTypes = [];
141 +
142 +
    return _dio
143 +
        .request(
144 +
      _path,
145 +
      queryParameters: queryParams,
146 +
      data: bodyData,
147 +
      options: Options(
148 +
        method: 'get'.toUpperCase(),
149 +
        headers: headerParams,
150 +
        extra: {
151 +
          'secure': [],
152 +
        },
153 +
        contentType:
154 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
155 +
      ),
156 +
      cancelToken: cancelToken,
157 +
    )
158 +
        .then((response) {
159 +
      final FullType type =
160 +
          const FullType(BuiltList, const [const FullType(Constraint)]);
161 +
      BuiltList<Constraint> dataList = _serializers.deserialize(
162 +
          response.data is String ? jsonDecode(response.data) : response.data,
163 +
          specifiedType: type);
164 +
      var data = dataList.toList();
165 +
166 +
      return Response<List<Constraint>>(
167 +
        data: data,
168 +
        headers: response.headers,
169 +
        request: response.request,
170 +
        redirects: response.redirects,
171 +
        statusCode: response.statusCode,
172 +
        statusMessage: response.statusMessage,
173 +
        extra: response.extra,
174 +
      );
175 +
    });
176 +
  }
177 +
178 +
  ///
179 +
  ///
180 +
  ///
181 +
  Future<Response<Constraint>> putConstraint(
182 +
    int flagID,
183 +
    int segmentID,
184 +
    int constraintID,
185 +
    CreateConstraintRequest body, {
186 +
    CancelToken cancelToken,
187 +
    Map<String, String> headers,
188 +
  }) async {
189 +
    String _path =
190 +
        "/flags/{flagID}/segments/{segmentID}/constraints/{constraintID}"
191 +
            .replaceAll("{" r'flagID' "}", flagID.toString())
192 +
            .replaceAll("{" r'segmentID' "}", segmentID.toString())
193 +
            .replaceAll("{" r'constraintID' "}", constraintID.toString());
194 +
195 +
    Map<String, dynamic> queryParams = {};
196 +
    Map<String, String> headerParams = Map.from(headers ?? {});
197 +
    dynamic bodyData;
198 +
199 +
    queryParams.removeWhere((key, value) => value == null);
200 +
    headerParams.removeWhere((key, value) => value == null);
201 +
202 +
    List<String> contentTypes = ["application/json"];
203 +
204 +
    var serializedBody = _serializers.serialize(body);
205 +
    var jsonbody = json.encode(serializedBody);
206 +
    bodyData = jsonbody;
207 +
208 +
    return _dio
209 +
        .request(
210 +
      _path,
211 +
      queryParameters: queryParams,
212 +
      data: bodyData,
213 +
      options: Options(
214 +
        method: 'put'.toUpperCase(),
215 +
        headers: headerParams,
216 +
        extra: {
217 +
          'secure': [],
218 +
        },
219 +
        contentType:
220 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
221 +
      ),
222 +
      cancelToken: cancelToken,
223 +
    )
224 +
        .then((response) {
225 +
      var serializer = _serializers.serializerForType(Constraint);
226 +
      var data = _serializers.deserializeWith<Constraint>(serializer,
227 +
          response.data is String ? jsonDecode(response.data) : response.data);
228 +
229 +
      return Response<Constraint>(
230 +
        data: data,
231 +
        headers: response.headers,
232 +
        request: response.request,
233 +
        redirects: response.redirects,
234 +
        statusCode: response.statusCode,
235 +
        statusMessage: response.statusMessage,
236 +
        extra: response.extra,
237 +
      );
238 +
    });
239 +
  }
240 +
}

@@ -1,29 +1,25 @@
Loading
1 -
            import 'package:built_value/json_object.dart';
2 -
        import 'package:built_value/built_value.dart';
1 +
import 'package:built_value/json_object.dart';
2 +
import 'package:built_value/built_value.dart';
3 3
import 'package:built_value/serializer.dart';
4 4
5 5
part 'variant.g.dart';
6 6
7 7
abstract class Variant implements Built<Variant, VariantBuilder> {
8 +
  @nullable
9 +
  @BuiltValueField(wireName: r'id')
10 +
  int get id;
8 11
9 -
    
10 -
        @nullable
11 -
    @BuiltValueField(wireName: r'id')
12 -
    int get id;
13 -
    
14 -
        @nullable
15 -
    @BuiltValueField(wireName: r'key')
16 -
    String get key;
17 -
    
18 -
        @nullable
19 -
    @BuiltValueField(wireName: r'attachment')
20 -
    JsonObject get attachment;
12 +
  @nullable
13 +
  @BuiltValueField(wireName: r'key')
14 +
  String get key;
21 15
22 -
    // Boilerplate code needed to wire-up generated code
23 -
    Variant._();
16 +
  @nullable
17 +
  @BuiltValueField(wireName: r'attachment')
18 +
  JsonObject get attachment;
24 19
25 -
    factory Variant([updates(VariantBuilder b)]) = _$Variant;
26 -
    static Serializer<Variant> get serializer => _$variantSerializer;
20 +
  // Boilerplate code needed to wire-up generated code
21 +
  Variant._();
27 22
23 +
  factory Variant([updates(VariantBuilder b)]) = _$Variant;
24 +
  static Serializer<Variant> get serializer => _$variantSerializer;
28 25
}
29 -

@@ -12,226 +12,263 @@
Loading
12 12
import 'package:flagr/model/error.dart';
13 13
14 14
class SegmentApi {
15 -
    final Dio _dio;
16 -
    Serializers _serializers;
17 -
18 -
    SegmentApi(this._dio, this._serializers);
19 -
20 -
        /// 
21 -
        ///
22 -
        /// 
23 -
        Future<Response<Segment>>createSegment(int flagID,CreateSegmentRequest body,{ CancelToken cancelToken, Map<String, String> headers,}) async {
24 -
25 -
        String _path = "/flags/{flagID}/segments".replaceAll("{" r'flagID' "}", flagID.toString());
26 -
27 -
        Map<String, dynamic> queryParams = {};
28 -
        Map<String, String> headerParams = Map.from(headers ?? {});
29 -
        dynamic bodyData;
30 -
31 -
        queryParams.removeWhere((key, value) => value == null);
32 -
        headerParams.removeWhere((key, value) => value == null);
33 -
34 -
        List<String> contentTypes = ["application/json"];
35 -
36 -
37 -
            var serializedBody = _serializers.serialize(body);
38 -
            var jsonbody = json.encode(serializedBody);
39 -
            bodyData = jsonbody;
40 -
41 -
            return _dio.request(
42 -
            _path,
43 -
            queryParameters: queryParams,
44 -
            data: bodyData,
45 -
            options: Options(
46 -
            method: 'post'.toUpperCase(),
47 -
            headers: headerParams,
48 -
            extra: {
49 -
                'secure': [],
50 -
            },
51 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
52 -
            ),
53 -
            cancelToken: cancelToken,
54 -
            ).then((response) {
55 -
56 -
        var serializer = _serializers.serializerForType(Segment);
57 -
        var data = _serializers.deserializeWith<Segment>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
58 -
59 -
            return Response<Segment>(
60 -
                data: data,
61 -
                headers: response.headers,
62 -
                request: response.request,
63 -
                redirects: response.redirects,
64 -
                statusCode: response.statusCode,
65 -
                statusMessage: response.statusMessage,
66 -
                extra: response.extra,
67 -
            );
68 -
            });
69 -
            }
70 -
        /// 
71 -
        ///
72 -
        /// 
73 -
        Future<Response>deleteSegment(int flagID,int segmentID,{ CancelToken cancelToken, Map<String, String> headers,}) async {
74 -
75 -
        String _path = "/flags/{flagID}/segments/{segmentID}".replaceAll("{" r'flagID' "}", flagID.toString()).replaceAll("{" r'segmentID' "}", segmentID.toString());
76 -
77 -
        Map<String, dynamic> queryParams = {};
78 -
        Map<String, String> headerParams = Map.from(headers ?? {});
79 -
        dynamic bodyData;
80 -
81 -
        queryParams.removeWhere((key, value) => value == null);
82 -
        headerParams.removeWhere((key, value) => value == null);
83 -
84 -
        List<String> contentTypes = [];
85 -
86 -
87 -
88 -
            return _dio.request(
89 -
            _path,
90 -
            queryParameters: queryParams,
91 -
            data: bodyData,
92 -
            options: Options(
93 -
            method: 'delete'.toUpperCase(),
94 -
            headers: headerParams,
95 -
            extra: {
96 -
                'secure': [],
97 -
            },
98 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
99 -
            ),
100 -
            cancelToken: cancelToken,
101 -
            );
102 -
            }
103 -
        /// 
104 -
        ///
105 -
        /// 
106 -
        Future<Response<List<Segment>>>findSegments(int flagID,{ CancelToken cancelToken, Map<String, String> headers,}) async {
107 -
108 -
        String _path = "/flags/{flagID}/segments".replaceAll("{" r'flagID' "}", flagID.toString());
109 -
110 -
        Map<String, dynamic> queryParams = {};
111 -
        Map<String, String> headerParams = Map.from(headers ?? {});
112 -
        dynamic bodyData;
113 -
114 -
        queryParams.removeWhere((key, value) => value == null);
115 -
        headerParams.removeWhere((key, value) => value == null);
116 -
117 -
        List<String> contentTypes = [];
118 -
119 -
120 -
121 -
            return _dio.request(
122 -
            _path,
123 -
            queryParameters: queryParams,
124 -
            data: bodyData,
125 -
            options: Options(
126 -
            method: 'get'.toUpperCase(),
127 -
            headers: headerParams,
128 -
            extra: {
129 -
                'secure': [],
130 -
            },
131 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
132 -
            ),
133 -
            cancelToken: cancelToken,
134 -
            ).then((response) {
135 -
136 -
                final FullType type = const FullType(BuiltList, const [const FullType(Segment)]);
137 -
                BuiltList<Segment> dataList = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
138 -
                var data = dataList.toList();
139 -
140 -
            return Response<List<Segment>>(
141 -
                data: data,
142 -
                headers: response.headers,
143 -
                request: response.request,
144 -
                redirects: response.redirects,
145 -
                statusCode: response.statusCode,
146 -
                statusMessage: response.statusMessage,
147 -
                extra: response.extra,
148 -
            );
149 -
            });
150 -
            }
151 -
        /// 
152 -
        ///
153 -
        /// 
154 -
        Future<Response<Segment>>putSegment(int flagID,int segmentID,PutSegmentRequest body,{ CancelToken cancelToken, Map<String, String> headers,}) async {
155 -
156 -
        String _path = "/flags/{flagID}/segments/{segmentID}".replaceAll("{" r'flagID' "}", flagID.toString()).replaceAll("{" r'segmentID' "}", segmentID.toString());
157 -
158 -
        Map<String, dynamic> queryParams = {};
159 -
        Map<String, String> headerParams = Map.from(headers ?? {});
160 -
        dynamic bodyData;
161 -
162 -
        queryParams.removeWhere((key, value) => value == null);
163 -
        headerParams.removeWhere((key, value) => value == null);
164 -
165 -
        List<String> contentTypes = ["application/json"];
166 -
167 -
168 -
            var serializedBody = _serializers.serialize(body);
169 -
            var jsonbody = json.encode(serializedBody);
170 -
            bodyData = jsonbody;
171 -
172 -
            return _dio.request(
173 -
            _path,
174 -
            queryParameters: queryParams,
175 -
            data: bodyData,
176 -
            options: Options(
177 -
            method: 'put'.toUpperCase(),
178 -
            headers: headerParams,
179 -
            extra: {
180 -
                'secure': [],
181 -
            },
182 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
183 -
            ),
184 -
            cancelToken: cancelToken,
185 -
            ).then((response) {
186 -
187 -
        var serializer = _serializers.serializerForType(Segment);
188 -
        var data = _serializers.deserializeWith<Segment>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
189 -
190 -
            return Response<Segment>(
191 -
                data: data,
192 -
                headers: response.headers,
193 -
                request: response.request,
194 -
                redirects: response.redirects,
195 -
                statusCode: response.statusCode,
196 -
                statusMessage: response.statusMessage,
197 -
                extra: response.extra,
198 -
            );
199 -
            });
200 -
            }
201 -
        /// 
202 -
        ///
203 -
        /// 
204 -
        Future<Response>putSegmentsReorder(int flagID,PutSegmentReorderRequest body,{ CancelToken cancelToken, Map<String, String> headers,}) async {
205 -
206 -
        String _path = "/flags/{flagID}/segments/reorder".replaceAll("{" r'flagID' "}", flagID.toString());
207 -
208 -
        Map<String, dynamic> queryParams = {};
209 -
        Map<String, String> headerParams = Map.from(headers ?? {});
210 -
        dynamic bodyData;
211 -
212 -
        queryParams.removeWhere((key, value) => value == null);
213 -
        headerParams.removeWhere((key, value) => value == null);
214 -
215 -
        List<String> contentTypes = ["application/json"];
216 -
217 -
218 -
            var serializedBody = _serializers.serialize(body);
219 -
            var jsonbody = json.encode(serializedBody);
220 -
            bodyData = jsonbody;
221 -
222 -
            return _dio.request(
223 -
            _path,
224 -
            queryParameters: queryParams,
225 -
            data: bodyData,
226 -
            options: Options(
227 -
            method: 'put'.toUpperCase(),
228 -
            headers: headerParams,
229 -
            extra: {
230 -
                'secure': [],
231 -
            },
232 -
            contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
233 -
            ),
234 -
            cancelToken: cancelToken,
235 -
            );
236 -
            }
237 -
        }
15 +
  final Dio _dio;
16 +
  Serializers _serializers;
17 +
18 +
  SegmentApi(this._dio, this._serializers);
19 +
20 +
  ///
21 +
  ///
22 +
  ///
23 +
  Future<Response<Segment>> createSegment(
24 +
    int flagID,
25 +
    CreateSegmentRequest body, {
26 +
    CancelToken cancelToken,
27 +
    Map<String, String> headers,
28 +
  }) async {
29 +
    String _path = "/flags/{flagID}/segments"
30 +
        .replaceAll("{" r'flagID' "}", flagID.toString());
31 +
32 +
    Map<String, dynamic> queryParams = {};
33 +
    Map<String, String> headerParams = Map.from(headers ?? {});
34 +
    dynamic bodyData;
35 +
36 +
    queryParams.removeWhere((key, value) => value == null);
37 +
    headerParams.removeWhere((key, value) => value == null);
38 +
39 +
    List<String> contentTypes = ["application/json"];
40 +
41 +
    var serializedBody = _serializers.serialize(body);
42 +
    var jsonbody = json.encode(serializedBody);
43 +
    bodyData = jsonbody;
44 +
45 +
    return _dio
46 +
        .request(
47 +
      _path,
48 +
      queryParameters: queryParams,
49 +
      data: bodyData,
50 +
      options: Options(
51 +
        method: 'post'.toUpperCase(),
52 +
        headers: headerParams,
53 +
        extra: {
54 +
          'secure': [],
55 +
        },
56 +
        contentType:
57 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
58 +
      ),
59 +
      cancelToken: cancelToken,
60 +
    )
61 +
        .then((response) {
62 +
      var serializer = _serializers.serializerForType(Segment);
63 +
      var data = _serializers.deserializeWith<Segment>(serializer,
64 +
          response.data is String ? jsonDecode(response.data) : response.data);
65 +
66 +
      return Response<Segment>(
67 +
        data: data,
68 +
        headers: response.headers,
69 +
        request: response.request,
70 +
        redirects: response.redirects,
71 +
        statusCode: response.statusCode,
72 +
        statusMessage: response.statusMessage,
73 +
        extra: response.extra,
74 +
      );
75 +
    });
76 +
  }
77 +
78 +
  ///
79 +
  ///
80 +
  ///
81 +
  Future<Response> deleteSegment(
82 +
    int flagID,
83 +
    int segmentID, {
84 +
    CancelToken cancelToken,
85 +
    Map<String, String> headers,
86 +
  }) async {
87 +
    String _path = "/flags/{flagID}/segments/{segmentID}"
88 +
        .replaceAll("{" r'flagID' "}", flagID.toString())
89 +
        .replaceAll("{" r'segmentID' "}", segmentID.toString());
90 +
91 +
    Map<String, dynamic> queryParams = {};
92 +
    Map<String, String> headerParams = Map.from(headers ?? {});
93 +
    dynamic bodyData;
94 +
95 +
    queryParams.removeWhere((key, value) => value == null);
96 +
    headerParams.removeWhere((key, value) => value == null);
97 +
98 +
    List<String> contentTypes = [];
99 +
100 +
    return _dio.request(
101 +
      _path,
102 +
      queryParameters: queryParams,
103 +
      data: bodyData,
104 +
      options: Options(
105 +
        method: 'delete'.toUpperCase(),
106 +
        headers: headerParams,
107 +
        extra: {
108 +
          'secure': [],
109 +
        },
110 +
        contentType:
111 +
            contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
112 +
      ),
113 +
      cancelToken: cancelToken,
114 +
    );
115 +
  }
116 +
117 +
  ///
118 +
  ///
119 +
  ///
120 +