Kevin Moore | af84e10 | 2021-02-25 10:29:32 -0800 | [diff] [blame] | 1 | // ignore_for_file: avoid_returning_null |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2 | // ignore_for_file: camel_case_types |
Kevin Moore | af84e10 | 2021-02-25 10:29:32 -0800 | [diff] [blame] | 3 | // ignore_for_file: cascade_invocations |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4 | // ignore_for_file: comment_references |
Kevin Moore | 1ad61ef | 2021-01-22 17:52:58 -0800 | [diff] [blame] | 5 | // ignore_for_file: file_names |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6 | // ignore_for_file: library_names |
| 7 | // ignore_for_file: lines_longer_than_80_chars |
| 8 | // ignore_for_file: non_constant_identifier_names |
Kevin Moore | 1ad61ef | 2021-01-22 17:52:58 -0800 | [diff] [blame] | 9 | // ignore_for_file: prefer_expression_function_bodies |
Kevin Moore | af84e10 | 2021-02-25 10:29:32 -0800 | [diff] [blame] | 10 | // ignore_for_file: prefer_final_locals |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 11 | // ignore_for_file: prefer_interpolation_to_compose_strings |
Kevin Moore | af84e10 | 2021-02-25 10:29:32 -0800 | [diff] [blame] | 12 | // ignore_for_file: prefer_single_quotes |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 13 | // ignore_for_file: unnecessary_brace_in_string_interps |
| 14 | // ignore_for_file: unnecessary_cast |
Kevin Moore | 1ad61ef | 2021-01-22 17:52:58 -0800 | [diff] [blame] | 15 | // ignore_for_file: unnecessary_lambdas |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 16 | // ignore_for_file: unnecessary_parenthesis |
| 17 | // ignore_for_file: unnecessary_string_interpolations |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 18 | // ignore_for_file: unused_local_variable |
| 19 | |
Kevin Moore | 2282df3 | 2021-01-27 19:15:24 -0800 | [diff] [blame] | 20 | import 'dart:async' as async; |
| 21 | import 'dart:convert' as convert; |
| 22 | import 'dart:core' as core; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 23 | |
Kevin Moore | 07f01b7 | 2021-04-25 17:33:47 -0700 | [diff] [blame] | 24 | import 'package:googleapis/ml/v1.dart' as api; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 25 | import 'package:http/http.dart' as http; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 26 | import 'package:test/test.dart' as unittest; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 27 | |
Kevin Moore | 2282df3 | 2021-01-27 19:15:24 -0800 | [diff] [blame] | 28 | import '../test_shared.dart'; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 29 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 30 | core.Map<core.String, core.Object> buildUnnamed7395() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 31 | var o = <core.String, core.Object>{}; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 32 | o['x'] = { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 33 | 'list': [1, 2, 3], |
| 34 | 'bool': true, |
| 35 | 'string': 'foo' |
| 36 | }; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 37 | o['y'] = { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 38 | 'list': [1, 2, 3], |
| 39 | 'bool': true, |
| 40 | 'string': 'foo' |
| 41 | }; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 42 | return o; |
| 43 | } |
| 44 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 45 | void checkUnnamed7395(core.Map<core.String, core.Object> o) { |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 46 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 47 | var casted1 = (o['x']!) as core.Map; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 48 | unittest.expect(casted1, unittest.hasLength(3)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 49 | unittest.expect( |
| 50 | casted1['list'], |
| 51 | unittest.equals([1, 2, 3]), |
| 52 | ); |
| 53 | unittest.expect( |
| 54 | casted1['bool'], |
| 55 | unittest.equals(true), |
| 56 | ); |
| 57 | unittest.expect( |
| 58 | casted1['string'], |
| 59 | unittest.equals('foo'), |
| 60 | ); |
| 61 | var casted2 = (o['y']!) as core.Map; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 62 | unittest.expect(casted2, unittest.hasLength(3)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 63 | unittest.expect( |
| 64 | casted2['list'], |
| 65 | unittest.equals([1, 2, 3]), |
| 66 | ); |
| 67 | unittest.expect( |
| 68 | casted2['bool'], |
| 69 | unittest.equals(true), |
| 70 | ); |
| 71 | unittest.expect( |
| 72 | casted2['string'], |
| 73 | unittest.equals('foo'), |
| 74 | ); |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 75 | } |
| 76 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 77 | core.List<core.Map<core.String, core.Object>> buildUnnamed7396() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 78 | var o = <core.Map<core.String, core.Object>>[]; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 79 | o.add(buildUnnamed7395()); |
| 80 | o.add(buildUnnamed7395()); |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 81 | return o; |
| 82 | } |
| 83 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 84 | void checkUnnamed7396(core.List<core.Map<core.String, core.Object>> o) { |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 85 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 86 | checkUnnamed7395(o[0]); |
| 87 | checkUnnamed7395(o[1]); |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 88 | } |
| 89 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 90 | core.int buildCounterGoogleApiHttpBody = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 91 | api.GoogleApiHttpBody buildGoogleApiHttpBody() { |
| 92 | var o = api.GoogleApiHttpBody(); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 93 | buildCounterGoogleApiHttpBody++; |
| 94 | if (buildCounterGoogleApiHttpBody < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 95 | o.contentType = 'foo'; |
| 96 | o.data = 'foo'; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 97 | o.extensions = buildUnnamed7396(); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 98 | } |
| 99 | buildCounterGoogleApiHttpBody--; |
| 100 | return o; |
| 101 | } |
| 102 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 103 | void checkGoogleApiHttpBody(api.GoogleApiHttpBody o) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 104 | buildCounterGoogleApiHttpBody++; |
| 105 | if (buildCounterGoogleApiHttpBody < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 106 | unittest.expect( |
| 107 | o.contentType!, |
| 108 | unittest.equals('foo'), |
| 109 | ); |
| 110 | unittest.expect( |
| 111 | o.data!, |
| 112 | unittest.equals('foo'), |
| 113 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 114 | checkUnnamed7396(o.extensions!); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 115 | } |
| 116 | buildCounterGoogleApiHttpBody--; |
| 117 | } |
| 118 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 119 | core.int |
| 120 | buildCounterGoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig = |
| 121 | 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 122 | api.GoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig |
| 123 | buildGoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig() { |
| 124 | var o = api |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 125 | .GoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig(); |
| 126 | buildCounterGoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig++; |
| 127 | if (buildCounterGoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig < |
| 128 | 3) { |
| 129 | o.useElapsedTime = true; |
| 130 | } |
| 131 | buildCounterGoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig--; |
| 132 | return o; |
| 133 | } |
| 134 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 135 | void checkGoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 136 | api.GoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig |
| 137 | o) { |
| 138 | buildCounterGoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig++; |
| 139 | if (buildCounterGoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig < |
| 140 | 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 141 | unittest.expect(o.useElapsedTime!, unittest.isTrue); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 142 | } |
| 143 | buildCounterGoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig--; |
| 144 | } |
| 145 | |
| 146 | core.int |
| 147 | buildCounterGoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig = |
| 148 | 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 149 | api.GoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig |
| 150 | buildGoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig() { |
| 151 | var o = |
| 152 | api.GoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 153 | buildCounterGoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig++; |
| 154 | if (buildCounterGoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig < |
| 155 | 3) { |
| 156 | o.useElapsedTime = true; |
| 157 | } |
| 158 | buildCounterGoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig--; |
| 159 | return o; |
| 160 | } |
| 161 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 162 | void checkGoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 163 | api.GoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig o) { |
| 164 | buildCounterGoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig++; |
| 165 | if (buildCounterGoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig < |
| 166 | 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 167 | unittest.expect(o.useElapsedTime!, unittest.isTrue); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 168 | } |
| 169 | buildCounterGoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig--; |
| 170 | } |
| 171 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 172 | core.int buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric = |
| 173 | 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 174 | api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric |
| 175 | buildGoogleCloudMlV1HyperparameterOutputHyperparameterMetric() { |
| 176 | var o = api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 177 | buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric++; |
| 178 | if (buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric < 3) { |
| 179 | o.objectiveValue = 42.0; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 180 | o.trainingStep = 'foo'; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 181 | } |
| 182 | buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric--; |
| 183 | return o; |
| 184 | } |
| 185 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 186 | void checkGoogleCloudMlV1HyperparameterOutputHyperparameterMetric( |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 187 | api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 188 | buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric++; |
| 189 | if (buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 190 | unittest.expect( |
| 191 | o.objectiveValue!, |
| 192 | unittest.equals(42.0), |
| 193 | ); |
| 194 | unittest.expect( |
| 195 | o.trainingStep!, |
| 196 | unittest.equals('foo'), |
| 197 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 198 | } |
| 199 | buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric--; |
| 200 | } |
| 201 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 202 | core.int buildCounterGoogleCloudMlV1MeasurementMetric = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 203 | api.GoogleCloudMlV1MeasurementMetric buildGoogleCloudMlV1MeasurementMetric() { |
| 204 | var o = api.GoogleCloudMlV1MeasurementMetric(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 205 | buildCounterGoogleCloudMlV1MeasurementMetric++; |
| 206 | if (buildCounterGoogleCloudMlV1MeasurementMetric < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 207 | o.metric = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 208 | o.value = 42.0; |
| 209 | } |
| 210 | buildCounterGoogleCloudMlV1MeasurementMetric--; |
| 211 | return o; |
| 212 | } |
| 213 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 214 | void checkGoogleCloudMlV1MeasurementMetric( |
| 215 | api.GoogleCloudMlV1MeasurementMetric o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 216 | buildCounterGoogleCloudMlV1MeasurementMetric++; |
| 217 | if (buildCounterGoogleCloudMlV1MeasurementMetric < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 218 | unittest.expect( |
| 219 | o.metric!, |
| 220 | unittest.equals('foo'), |
| 221 | ); |
| 222 | unittest.expect( |
| 223 | o.value!, |
| 224 | unittest.equals(42.0), |
| 225 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 226 | } |
| 227 | buildCounterGoogleCloudMlV1MeasurementMetric--; |
| 228 | } |
| 229 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 230 | core.List<core.String> buildUnnamed7397() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 231 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 232 | o.add('foo'); |
| 233 | o.add('foo'); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 234 | return o; |
| 235 | } |
| 236 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 237 | void checkUnnamed7397(core.List<core.String> o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 238 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 239 | unittest.expect( |
| 240 | o[0], |
| 241 | unittest.equals('foo'), |
| 242 | ); |
| 243 | unittest.expect( |
| 244 | o[1], |
| 245 | unittest.equals('foo'), |
| 246 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 247 | } |
| 248 | |
| 249 | core.int |
| 250 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 251 | api.GoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec |
| 252 | buildGoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec() { |
| 253 | var o = api.GoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 254 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec++; |
| 255 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec < |
| 256 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 257 | o.values = buildUnnamed7397(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 258 | } |
| 259 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec--; |
| 260 | return o; |
| 261 | } |
| 262 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 263 | void checkGoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 264 | api.GoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec o) { |
| 265 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec++; |
| 266 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec < |
| 267 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 268 | checkUnnamed7397(o.values!); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 269 | } |
| 270 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec--; |
| 271 | } |
| 272 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 273 | core.List<core.double> buildUnnamed7398() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 274 | var o = <core.double>[]; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 275 | o.add(42.0); |
| 276 | o.add(42.0); |
| 277 | return o; |
| 278 | } |
| 279 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 280 | void checkUnnamed7398(core.List<core.double> o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 281 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 282 | unittest.expect( |
| 283 | o[0], |
| 284 | unittest.equals(42.0), |
| 285 | ); |
| 286 | unittest.expect( |
| 287 | o[1], |
| 288 | unittest.equals(42.0), |
| 289 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 290 | } |
| 291 | |
| 292 | core.int buildCounterGoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec = |
| 293 | 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 294 | api.GoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec |
| 295 | buildGoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec() { |
| 296 | var o = api.GoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 297 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec++; |
| 298 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec < |
| 299 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 300 | o.values = buildUnnamed7398(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 301 | } |
| 302 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec--; |
| 303 | return o; |
| 304 | } |
| 305 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 306 | void checkGoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 307 | api.GoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec o) { |
| 308 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec++; |
| 309 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec < |
| 310 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 311 | checkUnnamed7398(o.values!); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 312 | } |
| 313 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec--; |
| 314 | } |
| 315 | |
| 316 | core.int buildCounterGoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 317 | api.GoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec |
| 318 | buildGoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec() { |
| 319 | var o = api.GoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 320 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec++; |
| 321 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec < 3) { |
| 322 | o.maxValue = 42.0; |
| 323 | o.minValue = 42.0; |
| 324 | } |
| 325 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec--; |
| 326 | return o; |
| 327 | } |
| 328 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 329 | void checkGoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 330 | api.GoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec o) { |
| 331 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec++; |
| 332 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 333 | unittest.expect( |
| 334 | o.maxValue!, |
| 335 | unittest.equals(42.0), |
| 336 | ); |
| 337 | unittest.expect( |
| 338 | o.minValue!, |
| 339 | unittest.equals(42.0), |
| 340 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 341 | } |
| 342 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec--; |
| 343 | } |
| 344 | |
| 345 | core.int buildCounterGoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec = |
| 346 | 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 347 | api.GoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec |
| 348 | buildGoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec() { |
| 349 | var o = api.GoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 350 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec++; |
| 351 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 352 | o.maxValue = 'foo'; |
| 353 | o.minValue = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 354 | } |
| 355 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec--; |
| 356 | return o; |
| 357 | } |
| 358 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 359 | void checkGoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 360 | api.GoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec o) { |
| 361 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec++; |
| 362 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 363 | unittest.expect( |
| 364 | o.maxValue!, |
| 365 | unittest.equals('foo'), |
| 366 | ); |
| 367 | unittest.expect( |
| 368 | o.minValue!, |
| 369 | unittest.equals('foo'), |
| 370 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 371 | } |
| 372 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec--; |
| 373 | } |
| 374 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 375 | core.List<core.String> buildUnnamed7399() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 376 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 377 | o.add('foo'); |
| 378 | o.add('foo'); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 379 | return o; |
| 380 | } |
| 381 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 382 | void checkUnnamed7399(core.List<core.String> o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 383 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 384 | unittest.expect( |
| 385 | o[0], |
| 386 | unittest.equals('foo'), |
| 387 | ); |
| 388 | unittest.expect( |
| 389 | o[1], |
| 390 | unittest.equals('foo'), |
| 391 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 392 | } |
| 393 | |
| 394 | core.int |
| 395 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec = |
| 396 | 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 397 | api.GoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec |
| 398 | buildGoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec() { |
| 399 | var o = api |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 400 | .GoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec(); |
| 401 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec++; |
| 402 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec < |
| 403 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 404 | o.values = buildUnnamed7399(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 405 | } |
| 406 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec--; |
| 407 | return o; |
| 408 | } |
| 409 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 410 | void checkGoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 411 | api.GoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec |
| 412 | o) { |
| 413 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec++; |
| 414 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec < |
| 415 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 416 | checkUnnamed7399(o.values!); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 417 | } |
| 418 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec--; |
| 419 | } |
| 420 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 421 | core.List<core.double> buildUnnamed7400() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 422 | var o = <core.double>[]; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 423 | o.add(42.0); |
| 424 | o.add(42.0); |
| 425 | return o; |
| 426 | } |
| 427 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 428 | void checkUnnamed7400(core.List<core.double> o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 429 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 430 | unittest.expect( |
| 431 | o[0], |
| 432 | unittest.equals(42.0), |
| 433 | ); |
| 434 | unittest.expect( |
| 435 | o[1], |
| 436 | unittest.equals(42.0), |
| 437 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 438 | } |
| 439 | |
| 440 | core.int |
| 441 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec = |
| 442 | 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 443 | api.GoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec |
| 444 | buildGoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec() { |
| 445 | var o = api |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 446 | .GoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec(); |
| 447 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec++; |
| 448 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec < |
| 449 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 450 | o.values = buildUnnamed7400(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 451 | } |
| 452 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec--; |
| 453 | return o; |
| 454 | } |
| 455 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 456 | void checkGoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 457 | api.GoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec |
| 458 | o) { |
| 459 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec++; |
| 460 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec < |
| 461 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 462 | checkUnnamed7400(o.values!); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 463 | } |
| 464 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec--; |
| 465 | } |
| 466 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 467 | core.List<core.String> buildUnnamed7401() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 468 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 469 | o.add('foo'); |
| 470 | o.add('foo'); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 471 | return o; |
| 472 | } |
| 473 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 474 | void checkUnnamed7401(core.List<core.String> o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 475 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 476 | unittest.expect( |
| 477 | o[0], |
| 478 | unittest.equals('foo'), |
| 479 | ); |
| 480 | unittest.expect( |
| 481 | o[1], |
| 482 | unittest.equals('foo'), |
| 483 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 484 | } |
| 485 | |
| 486 | core.int |
| 487 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec = |
| 488 | 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 489 | api.GoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec |
| 490 | buildGoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec() { |
| 491 | var o = |
| 492 | api.GoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 493 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec++; |
| 494 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec < |
| 495 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 496 | o.values = buildUnnamed7401(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 497 | } |
| 498 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec--; |
| 499 | return o; |
| 500 | } |
| 501 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 502 | void checkGoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 503 | api.GoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec o) { |
| 504 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec++; |
| 505 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec < |
| 506 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 507 | checkUnnamed7401(o.values!); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 508 | } |
| 509 | buildCounterGoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec--; |
| 510 | } |
| 511 | |
| 512 | core.int buildCounterGoogleCloudMlV1StudyConfigMetricSpec = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 513 | api.GoogleCloudMlV1StudyConfigMetricSpec |
| 514 | buildGoogleCloudMlV1StudyConfigMetricSpec() { |
| 515 | var o = api.GoogleCloudMlV1StudyConfigMetricSpec(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 516 | buildCounterGoogleCloudMlV1StudyConfigMetricSpec++; |
| 517 | if (buildCounterGoogleCloudMlV1StudyConfigMetricSpec < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 518 | o.goal = 'foo'; |
| 519 | o.metric = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 520 | } |
| 521 | buildCounterGoogleCloudMlV1StudyConfigMetricSpec--; |
| 522 | return o; |
| 523 | } |
| 524 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 525 | void checkGoogleCloudMlV1StudyConfigMetricSpec( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 526 | api.GoogleCloudMlV1StudyConfigMetricSpec o) { |
| 527 | buildCounterGoogleCloudMlV1StudyConfigMetricSpec++; |
| 528 | if (buildCounterGoogleCloudMlV1StudyConfigMetricSpec < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 529 | unittest.expect( |
| 530 | o.goal!, |
| 531 | unittest.equals('foo'), |
| 532 | ); |
| 533 | unittest.expect( |
| 534 | o.metric!, |
| 535 | unittest.equals('foo'), |
| 536 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 537 | } |
| 538 | buildCounterGoogleCloudMlV1StudyConfigMetricSpec--; |
| 539 | } |
| 540 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 541 | core.List<api.GoogleCloudMlV1StudyConfigParameterSpec> buildUnnamed7402() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 542 | var o = <api.GoogleCloudMlV1StudyConfigParameterSpec>[]; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 543 | o.add(buildGoogleCloudMlV1StudyConfigParameterSpec()); |
| 544 | o.add(buildGoogleCloudMlV1StudyConfigParameterSpec()); |
| 545 | return o; |
| 546 | } |
| 547 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 548 | void checkUnnamed7402( |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 549 | core.List<api.GoogleCloudMlV1StudyConfigParameterSpec> o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 550 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 551 | checkGoogleCloudMlV1StudyConfigParameterSpec( |
| 552 | o[0] as api.GoogleCloudMlV1StudyConfigParameterSpec); |
| 553 | checkGoogleCloudMlV1StudyConfigParameterSpec( |
| 554 | o[1] as api.GoogleCloudMlV1StudyConfigParameterSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 555 | } |
| 556 | |
| 557 | core.int buildCounterGoogleCloudMlV1StudyConfigParameterSpec = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 558 | api.GoogleCloudMlV1StudyConfigParameterSpec |
| 559 | buildGoogleCloudMlV1StudyConfigParameterSpec() { |
| 560 | var o = api.GoogleCloudMlV1StudyConfigParameterSpec(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 561 | buildCounterGoogleCloudMlV1StudyConfigParameterSpec++; |
| 562 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpec < 3) { |
| 563 | o.categoricalValueSpec = |
| 564 | buildGoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec(); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 565 | o.childParameterSpecs = buildUnnamed7402(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 566 | o.discreteValueSpec = |
| 567 | buildGoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec(); |
| 568 | o.doubleValueSpec = |
| 569 | buildGoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec(); |
| 570 | o.integerValueSpec = |
| 571 | buildGoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 572 | o.parameter = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 573 | o.parentCategoricalValues = |
| 574 | buildGoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec(); |
| 575 | o.parentDiscreteValues = |
| 576 | buildGoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec(); |
| 577 | o.parentIntValues = |
| 578 | buildGoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 579 | o.scaleType = 'foo'; |
| 580 | o.type = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 581 | } |
| 582 | buildCounterGoogleCloudMlV1StudyConfigParameterSpec--; |
| 583 | return o; |
| 584 | } |
| 585 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 586 | void checkGoogleCloudMlV1StudyConfigParameterSpec( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 587 | api.GoogleCloudMlV1StudyConfigParameterSpec o) { |
| 588 | buildCounterGoogleCloudMlV1StudyConfigParameterSpec++; |
| 589 | if (buildCounterGoogleCloudMlV1StudyConfigParameterSpec < 3) { |
| 590 | checkGoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 591 | o.categoricalValueSpec! |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 592 | as api.GoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 593 | checkUnnamed7402(o.childParameterSpecs!); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 594 | checkGoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 595 | o.discreteValueSpec! |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 596 | as api.GoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 597 | checkGoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 598 | o.doubleValueSpec! |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 599 | as api.GoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 600 | checkGoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 601 | o.integerValueSpec! |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 602 | as api.GoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 603 | unittest.expect( |
| 604 | o.parameter!, |
| 605 | unittest.equals('foo'), |
| 606 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 607 | checkGoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 608 | o.parentCategoricalValues! as api |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 609 | .GoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 610 | checkGoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 611 | o.parentDiscreteValues! as api |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 612 | .GoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 613 | checkGoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 614 | o.parentIntValues! as api |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 615 | .GoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 616 | unittest.expect( |
| 617 | o.scaleType!, |
| 618 | unittest.equals('foo'), |
| 619 | ); |
| 620 | unittest.expect( |
| 621 | o.type!, |
| 622 | unittest.equals('foo'), |
| 623 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 624 | } |
| 625 | buildCounterGoogleCloudMlV1StudyConfigParameterSpec--; |
| 626 | } |
| 627 | |
| 628 | core.int buildCounterGoogleCloudMlV1TrialParameter = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 629 | api.GoogleCloudMlV1TrialParameter buildGoogleCloudMlV1TrialParameter() { |
| 630 | var o = api.GoogleCloudMlV1TrialParameter(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 631 | buildCounterGoogleCloudMlV1TrialParameter++; |
| 632 | if (buildCounterGoogleCloudMlV1TrialParameter < 3) { |
| 633 | o.floatValue = 42.0; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 634 | o.intValue = 'foo'; |
| 635 | o.parameter = 'foo'; |
| 636 | o.stringValue = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 637 | } |
| 638 | buildCounterGoogleCloudMlV1TrialParameter--; |
| 639 | return o; |
| 640 | } |
| 641 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 642 | void checkGoogleCloudMlV1TrialParameter(api.GoogleCloudMlV1TrialParameter o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 643 | buildCounterGoogleCloudMlV1TrialParameter++; |
| 644 | if (buildCounterGoogleCloudMlV1TrialParameter < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 645 | unittest.expect( |
| 646 | o.floatValue!, |
| 647 | unittest.equals(42.0), |
| 648 | ); |
| 649 | unittest.expect( |
| 650 | o.intValue!, |
| 651 | unittest.equals('foo'), |
| 652 | ); |
| 653 | unittest.expect( |
| 654 | o.parameter!, |
| 655 | unittest.equals('foo'), |
| 656 | ); |
| 657 | unittest.expect( |
| 658 | o.stringValue!, |
| 659 | unittest.equals('foo'), |
| 660 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 661 | } |
| 662 | buildCounterGoogleCloudMlV1TrialParameter--; |
| 663 | } |
| 664 | |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 665 | core.int buildCounterGoogleCloudMlV1AcceleratorConfig = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 666 | api.GoogleCloudMlV1AcceleratorConfig buildGoogleCloudMlV1AcceleratorConfig() { |
| 667 | var o = api.GoogleCloudMlV1AcceleratorConfig(); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 668 | buildCounterGoogleCloudMlV1AcceleratorConfig++; |
| 669 | if (buildCounterGoogleCloudMlV1AcceleratorConfig < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 670 | o.count = 'foo'; |
| 671 | o.type = 'foo'; |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 672 | } |
| 673 | buildCounterGoogleCloudMlV1AcceleratorConfig--; |
| 674 | return o; |
| 675 | } |
| 676 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 677 | void checkGoogleCloudMlV1AcceleratorConfig( |
| 678 | api.GoogleCloudMlV1AcceleratorConfig o) { |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 679 | buildCounterGoogleCloudMlV1AcceleratorConfig++; |
| 680 | if (buildCounterGoogleCloudMlV1AcceleratorConfig < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 681 | unittest.expect( |
| 682 | o.count!, |
| 683 | unittest.equals('foo'), |
| 684 | ); |
| 685 | unittest.expect( |
| 686 | o.type!, |
| 687 | unittest.equals('foo'), |
| 688 | ); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 689 | } |
| 690 | buildCounterGoogleCloudMlV1AcceleratorConfig--; |
| 691 | } |
| 692 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 693 | core.int buildCounterGoogleCloudMlV1AddTrialMeasurementRequest = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 694 | api.GoogleCloudMlV1AddTrialMeasurementRequest |
| 695 | buildGoogleCloudMlV1AddTrialMeasurementRequest() { |
| 696 | var o = api.GoogleCloudMlV1AddTrialMeasurementRequest(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 697 | buildCounterGoogleCloudMlV1AddTrialMeasurementRequest++; |
| 698 | if (buildCounterGoogleCloudMlV1AddTrialMeasurementRequest < 3) { |
| 699 | o.measurement = buildGoogleCloudMlV1Measurement(); |
| 700 | } |
| 701 | buildCounterGoogleCloudMlV1AddTrialMeasurementRequest--; |
| 702 | return o; |
| 703 | } |
| 704 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 705 | void checkGoogleCloudMlV1AddTrialMeasurementRequest( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 706 | api.GoogleCloudMlV1AddTrialMeasurementRequest o) { |
| 707 | buildCounterGoogleCloudMlV1AddTrialMeasurementRequest++; |
| 708 | if (buildCounterGoogleCloudMlV1AddTrialMeasurementRequest < 3) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 709 | checkGoogleCloudMlV1Measurement( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 710 | o.measurement! as api.GoogleCloudMlV1Measurement); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 711 | } |
| 712 | buildCounterGoogleCloudMlV1AddTrialMeasurementRequest--; |
| 713 | } |
| 714 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 715 | core.List<api.GoogleCloudMlV1MetricSpec> buildUnnamed7403() { |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 716 | var o = <api.GoogleCloudMlV1MetricSpec>[]; |
| 717 | o.add(buildGoogleCloudMlV1MetricSpec()); |
| 718 | o.add(buildGoogleCloudMlV1MetricSpec()); |
| 719 | return o; |
| 720 | } |
| 721 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 722 | void checkUnnamed7403(core.List<api.GoogleCloudMlV1MetricSpec> o) { |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 723 | unittest.expect(o, unittest.hasLength(2)); |
| 724 | checkGoogleCloudMlV1MetricSpec(o[0] as api.GoogleCloudMlV1MetricSpec); |
| 725 | checkGoogleCloudMlV1MetricSpec(o[1] as api.GoogleCloudMlV1MetricSpec); |
| 726 | } |
| 727 | |
Martin Kustermann | fa83e31 | 2017-07-31 12:48:45 +0200 | [diff] [blame] | 728 | core.int buildCounterGoogleCloudMlV1AutoScaling = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 729 | api.GoogleCloudMlV1AutoScaling buildGoogleCloudMlV1AutoScaling() { |
| 730 | var o = api.GoogleCloudMlV1AutoScaling(); |
Martin Kustermann | fa83e31 | 2017-07-31 12:48:45 +0200 | [diff] [blame] | 731 | buildCounterGoogleCloudMlV1AutoScaling++; |
| 732 | if (buildCounterGoogleCloudMlV1AutoScaling < 3) { |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 733 | o.maxNodes = 42; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 734 | o.metrics = buildUnnamed7403(); |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 735 | o.minNodes = 42; |
| 736 | } |
Martin Kustermann | fa83e31 | 2017-07-31 12:48:45 +0200 | [diff] [blame] | 737 | buildCounterGoogleCloudMlV1AutoScaling--; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 738 | return o; |
| 739 | } |
| 740 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 741 | void checkGoogleCloudMlV1AutoScaling(api.GoogleCloudMlV1AutoScaling o) { |
Martin Kustermann | fa83e31 | 2017-07-31 12:48:45 +0200 | [diff] [blame] | 742 | buildCounterGoogleCloudMlV1AutoScaling++; |
| 743 | if (buildCounterGoogleCloudMlV1AutoScaling < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 744 | unittest.expect( |
| 745 | o.maxNodes!, |
| 746 | unittest.equals(42), |
| 747 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 748 | checkUnnamed7403(o.metrics!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 749 | unittest.expect( |
| 750 | o.minNodes!, |
| 751 | unittest.equals(42), |
| 752 | ); |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 753 | } |
Martin Kustermann | fa83e31 | 2017-07-31 12:48:45 +0200 | [diff] [blame] | 754 | buildCounterGoogleCloudMlV1AutoScaling--; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 755 | } |
| 756 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 757 | core.int buildCounterGoogleCloudMlV1AutomatedStoppingConfig = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 758 | api.GoogleCloudMlV1AutomatedStoppingConfig |
| 759 | buildGoogleCloudMlV1AutomatedStoppingConfig() { |
| 760 | var o = api.GoogleCloudMlV1AutomatedStoppingConfig(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 761 | buildCounterGoogleCloudMlV1AutomatedStoppingConfig++; |
| 762 | if (buildCounterGoogleCloudMlV1AutomatedStoppingConfig < 3) { |
| 763 | o.decayCurveStoppingConfig = |
| 764 | buildGoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig(); |
| 765 | o.medianAutomatedStoppingConfig = |
| 766 | buildGoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig(); |
| 767 | } |
| 768 | buildCounterGoogleCloudMlV1AutomatedStoppingConfig--; |
| 769 | return o; |
| 770 | } |
| 771 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 772 | void checkGoogleCloudMlV1AutomatedStoppingConfig( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 773 | api.GoogleCloudMlV1AutomatedStoppingConfig o) { |
| 774 | buildCounterGoogleCloudMlV1AutomatedStoppingConfig++; |
| 775 | if (buildCounterGoogleCloudMlV1AutomatedStoppingConfig < 3) { |
| 776 | checkGoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 777 | o.decayCurveStoppingConfig! as api |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 778 | .GoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 779 | checkGoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 780 | o.medianAutomatedStoppingConfig! as api |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 781 | .GoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 782 | } |
| 783 | buildCounterGoogleCloudMlV1AutomatedStoppingConfig--; |
| 784 | } |
| 785 | |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 786 | core.int buildCounterGoogleCloudMlV1BuiltInAlgorithmOutput = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 787 | api.GoogleCloudMlV1BuiltInAlgorithmOutput |
| 788 | buildGoogleCloudMlV1BuiltInAlgorithmOutput() { |
| 789 | var o = api.GoogleCloudMlV1BuiltInAlgorithmOutput(); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 790 | buildCounterGoogleCloudMlV1BuiltInAlgorithmOutput++; |
| 791 | if (buildCounterGoogleCloudMlV1BuiltInAlgorithmOutput < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 792 | o.framework = 'foo'; |
| 793 | o.modelPath = 'foo'; |
| 794 | o.pythonVersion = 'foo'; |
| 795 | o.runtimeVersion = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 796 | } |
| 797 | buildCounterGoogleCloudMlV1BuiltInAlgorithmOutput--; |
| 798 | return o; |
| 799 | } |
| 800 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 801 | void checkGoogleCloudMlV1BuiltInAlgorithmOutput( |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 802 | api.GoogleCloudMlV1BuiltInAlgorithmOutput o) { |
| 803 | buildCounterGoogleCloudMlV1BuiltInAlgorithmOutput++; |
| 804 | if (buildCounterGoogleCloudMlV1BuiltInAlgorithmOutput < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 805 | unittest.expect( |
| 806 | o.framework!, |
| 807 | unittest.equals('foo'), |
| 808 | ); |
| 809 | unittest.expect( |
| 810 | o.modelPath!, |
| 811 | unittest.equals('foo'), |
| 812 | ); |
| 813 | unittest.expect( |
| 814 | o.pythonVersion!, |
| 815 | unittest.equals('foo'), |
| 816 | ); |
| 817 | unittest.expect( |
| 818 | o.runtimeVersion!, |
| 819 | unittest.equals('foo'), |
| 820 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 821 | } |
| 822 | buildCounterGoogleCloudMlV1BuiltInAlgorithmOutput--; |
| 823 | } |
| 824 | |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 825 | core.int buildCounterGoogleCloudMlV1CancelJobRequest = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 826 | api.GoogleCloudMlV1CancelJobRequest buildGoogleCloudMlV1CancelJobRequest() { |
| 827 | var o = api.GoogleCloudMlV1CancelJobRequest(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 828 | buildCounterGoogleCloudMlV1CancelJobRequest++; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 829 | if (buildCounterGoogleCloudMlV1CancelJobRequest < 3) {} |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 830 | buildCounterGoogleCloudMlV1CancelJobRequest--; |
| 831 | return o; |
| 832 | } |
| 833 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 834 | void checkGoogleCloudMlV1CancelJobRequest( |
| 835 | api.GoogleCloudMlV1CancelJobRequest o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 836 | buildCounterGoogleCloudMlV1CancelJobRequest++; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 837 | if (buildCounterGoogleCloudMlV1CancelJobRequest < 3) {} |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 838 | buildCounterGoogleCloudMlV1CancelJobRequest--; |
| 839 | } |
| 840 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 841 | core.List<core.String> buildUnnamed7404() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 842 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 843 | o.add('foo'); |
| 844 | o.add('foo'); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 845 | return o; |
| 846 | } |
| 847 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 848 | void checkUnnamed7404(core.List<core.String> o) { |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 849 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 850 | unittest.expect( |
| 851 | o[0], |
| 852 | unittest.equals('foo'), |
| 853 | ); |
| 854 | unittest.expect( |
| 855 | o[1], |
| 856 | unittest.equals('foo'), |
| 857 | ); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 858 | } |
| 859 | |
| 860 | core.int buildCounterGoogleCloudMlV1Capability = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 861 | api.GoogleCloudMlV1Capability buildGoogleCloudMlV1Capability() { |
| 862 | var o = api.GoogleCloudMlV1Capability(); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 863 | buildCounterGoogleCloudMlV1Capability++; |
| 864 | if (buildCounterGoogleCloudMlV1Capability < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 865 | o.availableAccelerators = buildUnnamed7404(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 866 | o.type = 'foo'; |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 867 | } |
| 868 | buildCounterGoogleCloudMlV1Capability--; |
| 869 | return o; |
| 870 | } |
| 871 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 872 | void checkGoogleCloudMlV1Capability(api.GoogleCloudMlV1Capability o) { |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 873 | buildCounterGoogleCloudMlV1Capability++; |
| 874 | if (buildCounterGoogleCloudMlV1Capability < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 875 | checkUnnamed7404(o.availableAccelerators!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 876 | unittest.expect( |
| 877 | o.type!, |
| 878 | unittest.equals('foo'), |
| 879 | ); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 880 | } |
| 881 | buildCounterGoogleCloudMlV1Capability--; |
| 882 | } |
| 883 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 884 | core.int buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 885 | api.GoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata |
| 886 | buildGoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata() { |
| 887 | var o = api.GoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 888 | buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata++; |
| 889 | if (buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 890 | o.createTime = 'foo'; |
| 891 | o.study = 'foo'; |
| 892 | o.trial = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 893 | } |
| 894 | buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata--; |
| 895 | return o; |
| 896 | } |
| 897 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 898 | void checkGoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 899 | api.GoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata o) { |
| 900 | buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata++; |
| 901 | if (buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 902 | unittest.expect( |
| 903 | o.createTime!, |
| 904 | unittest.equals('foo'), |
| 905 | ); |
| 906 | unittest.expect( |
| 907 | o.study!, |
| 908 | unittest.equals('foo'), |
| 909 | ); |
| 910 | unittest.expect( |
| 911 | o.trial!, |
| 912 | unittest.equals('foo'), |
| 913 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 914 | } |
| 915 | buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata--; |
| 916 | } |
| 917 | |
| 918 | core.int buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateRequest = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 919 | api.GoogleCloudMlV1CheckTrialEarlyStoppingStateRequest |
| 920 | buildGoogleCloudMlV1CheckTrialEarlyStoppingStateRequest() { |
| 921 | var o = api.GoogleCloudMlV1CheckTrialEarlyStoppingStateRequest(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 922 | buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateRequest++; |
| 923 | if (buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateRequest < 3) {} |
| 924 | buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateRequest--; |
| 925 | return o; |
| 926 | } |
| 927 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 928 | void checkGoogleCloudMlV1CheckTrialEarlyStoppingStateRequest( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 929 | api.GoogleCloudMlV1CheckTrialEarlyStoppingStateRequest o) { |
| 930 | buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateRequest++; |
| 931 | if (buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateRequest < 3) {} |
| 932 | buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateRequest--; |
| 933 | } |
| 934 | |
| 935 | core.int buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 936 | api.GoogleCloudMlV1CheckTrialEarlyStoppingStateResponse |
| 937 | buildGoogleCloudMlV1CheckTrialEarlyStoppingStateResponse() { |
| 938 | var o = api.GoogleCloudMlV1CheckTrialEarlyStoppingStateResponse(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 939 | buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateResponse++; |
| 940 | if (buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateResponse < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 941 | o.endTime = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 942 | o.shouldStop = true; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 943 | o.startTime = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 944 | } |
| 945 | buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateResponse--; |
| 946 | return o; |
| 947 | } |
| 948 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 949 | void checkGoogleCloudMlV1CheckTrialEarlyStoppingStateResponse( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 950 | api.GoogleCloudMlV1CheckTrialEarlyStoppingStateResponse o) { |
| 951 | buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateResponse++; |
| 952 | if (buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateResponse < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 953 | unittest.expect( |
| 954 | o.endTime!, |
| 955 | unittest.equals('foo'), |
| 956 | ); |
| 957 | unittest.expect(o.shouldStop!, unittest.isTrue); |
| 958 | unittest.expect( |
| 959 | o.startTime!, |
| 960 | unittest.equals('foo'), |
| 961 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 962 | } |
| 963 | buildCounterGoogleCloudMlV1CheckTrialEarlyStoppingStateResponse--; |
| 964 | } |
| 965 | |
| 966 | core.int buildCounterGoogleCloudMlV1CompleteTrialRequest = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 967 | api.GoogleCloudMlV1CompleteTrialRequest |
| 968 | buildGoogleCloudMlV1CompleteTrialRequest() { |
| 969 | var o = api.GoogleCloudMlV1CompleteTrialRequest(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 970 | buildCounterGoogleCloudMlV1CompleteTrialRequest++; |
| 971 | if (buildCounterGoogleCloudMlV1CompleteTrialRequest < 3) { |
| 972 | o.finalMeasurement = buildGoogleCloudMlV1Measurement(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 973 | o.infeasibleReason = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 974 | o.trialInfeasible = true; |
| 975 | } |
| 976 | buildCounterGoogleCloudMlV1CompleteTrialRequest--; |
| 977 | return o; |
| 978 | } |
| 979 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 980 | void checkGoogleCloudMlV1CompleteTrialRequest( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 981 | api.GoogleCloudMlV1CompleteTrialRequest o) { |
| 982 | buildCounterGoogleCloudMlV1CompleteTrialRequest++; |
| 983 | if (buildCounterGoogleCloudMlV1CompleteTrialRequest < 3) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 984 | checkGoogleCloudMlV1Measurement( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 985 | o.finalMeasurement! as api.GoogleCloudMlV1Measurement); |
| 986 | unittest.expect( |
| 987 | o.infeasibleReason!, |
| 988 | unittest.equals('foo'), |
| 989 | ); |
| 990 | unittest.expect(o.trialInfeasible!, unittest.isTrue); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 991 | } |
| 992 | buildCounterGoogleCloudMlV1CompleteTrialRequest--; |
| 993 | } |
| 994 | |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 995 | core.int buildCounterGoogleCloudMlV1Config = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 996 | api.GoogleCloudMlV1Config buildGoogleCloudMlV1Config() { |
| 997 | var o = api.GoogleCloudMlV1Config(); |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 998 | buildCounterGoogleCloudMlV1Config++; |
| 999 | if (buildCounterGoogleCloudMlV1Config < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1000 | o.tpuServiceAccount = 'foo'; |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 1001 | } |
| 1002 | buildCounterGoogleCloudMlV1Config--; |
| 1003 | return o; |
| 1004 | } |
| 1005 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1006 | void checkGoogleCloudMlV1Config(api.GoogleCloudMlV1Config o) { |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 1007 | buildCounterGoogleCloudMlV1Config++; |
| 1008 | if (buildCounterGoogleCloudMlV1Config < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1009 | unittest.expect( |
| 1010 | o.tpuServiceAccount!, |
| 1011 | unittest.equals('foo'), |
| 1012 | ); |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 1013 | } |
| 1014 | buildCounterGoogleCloudMlV1Config--; |
| 1015 | } |
| 1016 | |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1017 | core.int buildCounterGoogleCloudMlV1ContainerPort = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1018 | api.GoogleCloudMlV1ContainerPort buildGoogleCloudMlV1ContainerPort() { |
| 1019 | var o = api.GoogleCloudMlV1ContainerPort(); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1020 | buildCounterGoogleCloudMlV1ContainerPort++; |
| 1021 | if (buildCounterGoogleCloudMlV1ContainerPort < 3) { |
| 1022 | o.containerPort = 42; |
| 1023 | } |
| 1024 | buildCounterGoogleCloudMlV1ContainerPort--; |
| 1025 | return o; |
| 1026 | } |
| 1027 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1028 | void checkGoogleCloudMlV1ContainerPort(api.GoogleCloudMlV1ContainerPort o) { |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1029 | buildCounterGoogleCloudMlV1ContainerPort++; |
| 1030 | if (buildCounterGoogleCloudMlV1ContainerPort < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1031 | unittest.expect( |
| 1032 | o.containerPort!, |
| 1033 | unittest.equals(42), |
| 1034 | ); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1035 | } |
| 1036 | buildCounterGoogleCloudMlV1ContainerPort--; |
| 1037 | } |
| 1038 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1039 | core.List<core.String> buildUnnamed7405() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1040 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1041 | o.add('foo'); |
| 1042 | o.add('foo'); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1043 | return o; |
| 1044 | } |
| 1045 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1046 | void checkUnnamed7405(core.List<core.String> o) { |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1047 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1048 | unittest.expect( |
| 1049 | o[0], |
| 1050 | unittest.equals('foo'), |
| 1051 | ); |
| 1052 | unittest.expect( |
| 1053 | o[1], |
| 1054 | unittest.equals('foo'), |
| 1055 | ); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1056 | } |
| 1057 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1058 | core.List<core.String> buildUnnamed7406() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1059 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1060 | o.add('foo'); |
| 1061 | o.add('foo'); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1062 | return o; |
| 1063 | } |
| 1064 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1065 | void checkUnnamed7406(core.List<core.String> o) { |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1066 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1067 | unittest.expect( |
| 1068 | o[0], |
| 1069 | unittest.equals('foo'), |
| 1070 | ); |
| 1071 | unittest.expect( |
| 1072 | o[1], |
| 1073 | unittest.equals('foo'), |
| 1074 | ); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1075 | } |
| 1076 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1077 | core.List<api.GoogleCloudMlV1EnvVar> buildUnnamed7407() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1078 | var o = <api.GoogleCloudMlV1EnvVar>[]; |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1079 | o.add(buildGoogleCloudMlV1EnvVar()); |
| 1080 | o.add(buildGoogleCloudMlV1EnvVar()); |
| 1081 | return o; |
| 1082 | } |
| 1083 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1084 | void checkUnnamed7407(core.List<api.GoogleCloudMlV1EnvVar> o) { |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1085 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1086 | checkGoogleCloudMlV1EnvVar(o[0] as api.GoogleCloudMlV1EnvVar); |
| 1087 | checkGoogleCloudMlV1EnvVar(o[1] as api.GoogleCloudMlV1EnvVar); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1088 | } |
| 1089 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1090 | core.List<api.GoogleCloudMlV1ContainerPort> buildUnnamed7408() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1091 | var o = <api.GoogleCloudMlV1ContainerPort>[]; |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1092 | o.add(buildGoogleCloudMlV1ContainerPort()); |
| 1093 | o.add(buildGoogleCloudMlV1ContainerPort()); |
| 1094 | return o; |
| 1095 | } |
| 1096 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1097 | void checkUnnamed7408(core.List<api.GoogleCloudMlV1ContainerPort> o) { |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1098 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1099 | checkGoogleCloudMlV1ContainerPort(o[0] as api.GoogleCloudMlV1ContainerPort); |
| 1100 | checkGoogleCloudMlV1ContainerPort(o[1] as api.GoogleCloudMlV1ContainerPort); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1101 | } |
| 1102 | |
| 1103 | core.int buildCounterGoogleCloudMlV1ContainerSpec = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1104 | api.GoogleCloudMlV1ContainerSpec buildGoogleCloudMlV1ContainerSpec() { |
| 1105 | var o = api.GoogleCloudMlV1ContainerSpec(); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1106 | buildCounterGoogleCloudMlV1ContainerSpec++; |
| 1107 | if (buildCounterGoogleCloudMlV1ContainerSpec < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1108 | o.args = buildUnnamed7405(); |
| 1109 | o.command = buildUnnamed7406(); |
| 1110 | o.env = buildUnnamed7407(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1111 | o.image = 'foo'; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1112 | o.ports = buildUnnamed7408(); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1113 | } |
| 1114 | buildCounterGoogleCloudMlV1ContainerSpec--; |
| 1115 | return o; |
| 1116 | } |
| 1117 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1118 | void checkGoogleCloudMlV1ContainerSpec(api.GoogleCloudMlV1ContainerSpec o) { |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1119 | buildCounterGoogleCloudMlV1ContainerSpec++; |
| 1120 | if (buildCounterGoogleCloudMlV1ContainerSpec < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1121 | checkUnnamed7405(o.args!); |
| 1122 | checkUnnamed7406(o.command!); |
| 1123 | checkUnnamed7407(o.env!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1124 | unittest.expect( |
| 1125 | o.image!, |
| 1126 | unittest.equals('foo'), |
| 1127 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1128 | checkUnnamed7408(o.ports!); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1129 | } |
| 1130 | buildCounterGoogleCloudMlV1ContainerSpec--; |
| 1131 | } |
| 1132 | |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 1133 | core.int buildCounterGoogleCloudMlV1DiskConfig = 0; |
| 1134 | api.GoogleCloudMlV1DiskConfig buildGoogleCloudMlV1DiskConfig() { |
| 1135 | var o = api.GoogleCloudMlV1DiskConfig(); |
| 1136 | buildCounterGoogleCloudMlV1DiskConfig++; |
| 1137 | if (buildCounterGoogleCloudMlV1DiskConfig < 3) { |
| 1138 | o.bootDiskSizeGb = 42; |
| 1139 | o.bootDiskType = 'foo'; |
| 1140 | } |
| 1141 | buildCounterGoogleCloudMlV1DiskConfig--; |
| 1142 | return o; |
| 1143 | } |
| 1144 | |
| 1145 | void checkGoogleCloudMlV1DiskConfig(api.GoogleCloudMlV1DiskConfig o) { |
| 1146 | buildCounterGoogleCloudMlV1DiskConfig++; |
| 1147 | if (buildCounterGoogleCloudMlV1DiskConfig < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1148 | unittest.expect( |
| 1149 | o.bootDiskSizeGb!, |
| 1150 | unittest.equals(42), |
| 1151 | ); |
| 1152 | unittest.expect( |
| 1153 | o.bootDiskType!, |
| 1154 | unittest.equals('foo'), |
| 1155 | ); |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 1156 | } |
| 1157 | buildCounterGoogleCloudMlV1DiskConfig--; |
| 1158 | } |
| 1159 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1160 | core.int buildCounterGoogleCloudMlV1EncryptionConfig = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1161 | api.GoogleCloudMlV1EncryptionConfig buildGoogleCloudMlV1EncryptionConfig() { |
| 1162 | var o = api.GoogleCloudMlV1EncryptionConfig(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1163 | buildCounterGoogleCloudMlV1EncryptionConfig++; |
| 1164 | if (buildCounterGoogleCloudMlV1EncryptionConfig < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1165 | o.kmsKeyName = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1166 | } |
| 1167 | buildCounterGoogleCloudMlV1EncryptionConfig--; |
| 1168 | return o; |
| 1169 | } |
| 1170 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1171 | void checkGoogleCloudMlV1EncryptionConfig( |
| 1172 | api.GoogleCloudMlV1EncryptionConfig o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1173 | buildCounterGoogleCloudMlV1EncryptionConfig++; |
| 1174 | if (buildCounterGoogleCloudMlV1EncryptionConfig < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1175 | unittest.expect( |
| 1176 | o.kmsKeyName!, |
| 1177 | unittest.equals('foo'), |
| 1178 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1179 | } |
| 1180 | buildCounterGoogleCloudMlV1EncryptionConfig--; |
| 1181 | } |
| 1182 | |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1183 | core.int buildCounterGoogleCloudMlV1EnvVar = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1184 | api.GoogleCloudMlV1EnvVar buildGoogleCloudMlV1EnvVar() { |
| 1185 | var o = api.GoogleCloudMlV1EnvVar(); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1186 | buildCounterGoogleCloudMlV1EnvVar++; |
| 1187 | if (buildCounterGoogleCloudMlV1EnvVar < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1188 | o.name = 'foo'; |
| 1189 | o.value = 'foo'; |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1190 | } |
| 1191 | buildCounterGoogleCloudMlV1EnvVar--; |
| 1192 | return o; |
| 1193 | } |
| 1194 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1195 | void checkGoogleCloudMlV1EnvVar(api.GoogleCloudMlV1EnvVar o) { |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1196 | buildCounterGoogleCloudMlV1EnvVar++; |
| 1197 | if (buildCounterGoogleCloudMlV1EnvVar < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1198 | unittest.expect( |
| 1199 | o.name!, |
| 1200 | unittest.equals('foo'), |
| 1201 | ); |
| 1202 | unittest.expect( |
| 1203 | o.value!, |
| 1204 | unittest.equals('foo'), |
| 1205 | ); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1206 | } |
| 1207 | buildCounterGoogleCloudMlV1EnvVar--; |
| 1208 | } |
| 1209 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1210 | core.int buildCounterGoogleCloudMlV1ExplainRequest = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1211 | api.GoogleCloudMlV1ExplainRequest buildGoogleCloudMlV1ExplainRequest() { |
| 1212 | var o = api.GoogleCloudMlV1ExplainRequest(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1213 | buildCounterGoogleCloudMlV1ExplainRequest++; |
| 1214 | if (buildCounterGoogleCloudMlV1ExplainRequest < 3) { |
| 1215 | o.httpBody = buildGoogleApiHttpBody(); |
| 1216 | } |
| 1217 | buildCounterGoogleCloudMlV1ExplainRequest--; |
| 1218 | return o; |
| 1219 | } |
| 1220 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1221 | void checkGoogleCloudMlV1ExplainRequest(api.GoogleCloudMlV1ExplainRequest o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1222 | buildCounterGoogleCloudMlV1ExplainRequest++; |
| 1223 | if (buildCounterGoogleCloudMlV1ExplainRequest < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1224 | checkGoogleApiHttpBody(o.httpBody! as api.GoogleApiHttpBody); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1225 | } |
| 1226 | buildCounterGoogleCloudMlV1ExplainRequest--; |
| 1227 | } |
| 1228 | |
| 1229 | core.int buildCounterGoogleCloudMlV1ExplanationConfig = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1230 | api.GoogleCloudMlV1ExplanationConfig buildGoogleCloudMlV1ExplanationConfig() { |
| 1231 | var o = api.GoogleCloudMlV1ExplanationConfig(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1232 | buildCounterGoogleCloudMlV1ExplanationConfig++; |
| 1233 | if (buildCounterGoogleCloudMlV1ExplanationConfig < 3) { |
| 1234 | o.integratedGradientsAttribution = |
| 1235 | buildGoogleCloudMlV1IntegratedGradientsAttribution(); |
| 1236 | o.sampledShapleyAttribution = |
| 1237 | buildGoogleCloudMlV1SampledShapleyAttribution(); |
| 1238 | o.xraiAttribution = buildGoogleCloudMlV1XraiAttribution(); |
| 1239 | } |
| 1240 | buildCounterGoogleCloudMlV1ExplanationConfig--; |
| 1241 | return o; |
| 1242 | } |
| 1243 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1244 | void checkGoogleCloudMlV1ExplanationConfig( |
| 1245 | api.GoogleCloudMlV1ExplanationConfig o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1246 | buildCounterGoogleCloudMlV1ExplanationConfig++; |
| 1247 | if (buildCounterGoogleCloudMlV1ExplanationConfig < 3) { |
| 1248 | checkGoogleCloudMlV1IntegratedGradientsAttribution( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1249 | o.integratedGradientsAttribution! |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1250 | as api.GoogleCloudMlV1IntegratedGradientsAttribution); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1251 | checkGoogleCloudMlV1SampledShapleyAttribution(o.sampledShapleyAttribution! |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1252 | as api.GoogleCloudMlV1SampledShapleyAttribution); |
| 1253 | checkGoogleCloudMlV1XraiAttribution( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1254 | o.xraiAttribution! as api.GoogleCloudMlV1XraiAttribution); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1255 | } |
| 1256 | buildCounterGoogleCloudMlV1ExplanationConfig--; |
| 1257 | } |
| 1258 | |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1259 | core.int buildCounterGoogleCloudMlV1GetConfigResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1260 | api.GoogleCloudMlV1GetConfigResponse buildGoogleCloudMlV1GetConfigResponse() { |
| 1261 | var o = api.GoogleCloudMlV1GetConfigResponse(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1262 | buildCounterGoogleCloudMlV1GetConfigResponse++; |
| 1263 | if (buildCounterGoogleCloudMlV1GetConfigResponse < 3) { |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 1264 | o.config = buildGoogleCloudMlV1Config(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1265 | o.serviceAccount = 'foo'; |
| 1266 | o.serviceAccountProject = 'foo'; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1267 | } |
| 1268 | buildCounterGoogleCloudMlV1GetConfigResponse--; |
| 1269 | return o; |
| 1270 | } |
| 1271 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1272 | void checkGoogleCloudMlV1GetConfigResponse( |
| 1273 | api.GoogleCloudMlV1GetConfigResponse o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1274 | buildCounterGoogleCloudMlV1GetConfigResponse++; |
| 1275 | if (buildCounterGoogleCloudMlV1GetConfigResponse < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1276 | checkGoogleCloudMlV1Config(o.config! as api.GoogleCloudMlV1Config); |
| 1277 | unittest.expect( |
| 1278 | o.serviceAccount!, |
| 1279 | unittest.equals('foo'), |
| 1280 | ); |
| 1281 | unittest.expect( |
| 1282 | o.serviceAccountProject!, |
| 1283 | unittest.equals('foo'), |
| 1284 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1285 | } |
| 1286 | buildCounterGoogleCloudMlV1GetConfigResponse--; |
| 1287 | } |
| 1288 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1289 | core.List<api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric> |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1290 | buildUnnamed7409() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1291 | var o = <api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric>[]; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1292 | o.add(buildGoogleCloudMlV1HyperparameterOutputHyperparameterMetric()); |
| 1293 | o.add(buildGoogleCloudMlV1HyperparameterOutputHyperparameterMetric()); |
| 1294 | return o; |
| 1295 | } |
| 1296 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1297 | void checkUnnamed7409( |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1298 | core.List<api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric> o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1299 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1300 | checkGoogleCloudMlV1HyperparameterOutputHyperparameterMetric( |
| 1301 | o[0] as api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric); |
| 1302 | checkGoogleCloudMlV1HyperparameterOutputHyperparameterMetric( |
| 1303 | o[1] as api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1304 | } |
| 1305 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1306 | core.Map<core.String, core.String> buildUnnamed7410() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1307 | var o = <core.String, core.String>{}; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1308 | o['x'] = 'foo'; |
| 1309 | o['y'] = 'foo'; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1310 | return o; |
| 1311 | } |
| 1312 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1313 | void checkUnnamed7410(core.Map<core.String, core.String> o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1314 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1315 | unittest.expect( |
| 1316 | o['x']!, |
| 1317 | unittest.equals('foo'), |
| 1318 | ); |
| 1319 | unittest.expect( |
| 1320 | o['y']!, |
| 1321 | unittest.equals('foo'), |
| 1322 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1323 | } |
| 1324 | |
| 1325 | core.int buildCounterGoogleCloudMlV1HyperparameterOutput = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1326 | api.GoogleCloudMlV1HyperparameterOutput |
| 1327 | buildGoogleCloudMlV1HyperparameterOutput() { |
| 1328 | var o = api.GoogleCloudMlV1HyperparameterOutput(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1329 | buildCounterGoogleCloudMlV1HyperparameterOutput++; |
| 1330 | if (buildCounterGoogleCloudMlV1HyperparameterOutput < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1331 | o.allMetrics = buildUnnamed7409(); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1332 | o.builtInAlgorithmOutput = buildGoogleCloudMlV1BuiltInAlgorithmOutput(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1333 | o.endTime = 'foo'; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1334 | o.finalMetric = |
| 1335 | buildGoogleCloudMlV1HyperparameterOutputHyperparameterMetric(); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1336 | o.hyperparameters = buildUnnamed7410(); |
Martin Kustermann | 67f25a2 | 2018-01-26 23:31:34 +0100 | [diff] [blame] | 1337 | o.isTrialStoppedEarly = true; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1338 | o.startTime = 'foo'; |
| 1339 | o.state = 'foo'; |
| 1340 | o.trialId = 'foo'; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1341 | } |
| 1342 | buildCounterGoogleCloudMlV1HyperparameterOutput--; |
| 1343 | return o; |
| 1344 | } |
| 1345 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1346 | void checkGoogleCloudMlV1HyperparameterOutput( |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1347 | api.GoogleCloudMlV1HyperparameterOutput o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1348 | buildCounterGoogleCloudMlV1HyperparameterOutput++; |
| 1349 | if (buildCounterGoogleCloudMlV1HyperparameterOutput < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1350 | checkUnnamed7409(o.allMetrics!); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1351 | checkGoogleCloudMlV1BuiltInAlgorithmOutput( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1352 | o.builtInAlgorithmOutput! as api.GoogleCloudMlV1BuiltInAlgorithmOutput); |
| 1353 | unittest.expect( |
| 1354 | o.endTime!, |
| 1355 | unittest.equals('foo'), |
| 1356 | ); |
| 1357 | checkGoogleCloudMlV1HyperparameterOutputHyperparameterMetric(o.finalMetric! |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1358 | as api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1359 | checkUnnamed7410(o.hyperparameters!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1360 | unittest.expect(o.isTrialStoppedEarly!, unittest.isTrue); |
| 1361 | unittest.expect( |
| 1362 | o.startTime!, |
| 1363 | unittest.equals('foo'), |
| 1364 | ); |
| 1365 | unittest.expect( |
| 1366 | o.state!, |
| 1367 | unittest.equals('foo'), |
| 1368 | ); |
| 1369 | unittest.expect( |
| 1370 | o.trialId!, |
| 1371 | unittest.equals('foo'), |
| 1372 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1373 | } |
| 1374 | buildCounterGoogleCloudMlV1HyperparameterOutput--; |
| 1375 | } |
| 1376 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1377 | core.List<api.GoogleCloudMlV1ParameterSpec> buildUnnamed7411() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1378 | var o = <api.GoogleCloudMlV1ParameterSpec>[]; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1379 | o.add(buildGoogleCloudMlV1ParameterSpec()); |
| 1380 | o.add(buildGoogleCloudMlV1ParameterSpec()); |
| 1381 | return o; |
| 1382 | } |
| 1383 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1384 | void checkUnnamed7411(core.List<api.GoogleCloudMlV1ParameterSpec> o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1385 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1386 | checkGoogleCloudMlV1ParameterSpec(o[0] as api.GoogleCloudMlV1ParameterSpec); |
| 1387 | checkGoogleCloudMlV1ParameterSpec(o[1] as api.GoogleCloudMlV1ParameterSpec); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1388 | } |
| 1389 | |
| 1390 | core.int buildCounterGoogleCloudMlV1HyperparameterSpec = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1391 | api.GoogleCloudMlV1HyperparameterSpec buildGoogleCloudMlV1HyperparameterSpec() { |
| 1392 | var o = api.GoogleCloudMlV1HyperparameterSpec(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1393 | buildCounterGoogleCloudMlV1HyperparameterSpec++; |
| 1394 | if (buildCounterGoogleCloudMlV1HyperparameterSpec < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1395 | o.algorithm = 'foo'; |
Martin Kustermann | a525076 | 2018-02-19 12:56:45 +0100 | [diff] [blame] | 1396 | o.enableTrialEarlyStopping = true; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1397 | o.goal = 'foo'; |
| 1398 | o.hyperparameterMetricTag = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1399 | o.maxFailedTrials = 42; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1400 | o.maxParallelTrials = 42; |
| 1401 | o.maxTrials = 42; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1402 | o.params = buildUnnamed7411(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1403 | o.resumePreviousJobId = 'foo'; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1404 | } |
| 1405 | buildCounterGoogleCloudMlV1HyperparameterSpec--; |
| 1406 | return o; |
| 1407 | } |
| 1408 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1409 | void checkGoogleCloudMlV1HyperparameterSpec( |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1410 | api.GoogleCloudMlV1HyperparameterSpec o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1411 | buildCounterGoogleCloudMlV1HyperparameterSpec++; |
| 1412 | if (buildCounterGoogleCloudMlV1HyperparameterSpec < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1413 | unittest.expect( |
| 1414 | o.algorithm!, |
| 1415 | unittest.equals('foo'), |
| 1416 | ); |
| 1417 | unittest.expect(o.enableTrialEarlyStopping!, unittest.isTrue); |
| 1418 | unittest.expect( |
| 1419 | o.goal!, |
| 1420 | unittest.equals('foo'), |
| 1421 | ); |
| 1422 | unittest.expect( |
| 1423 | o.hyperparameterMetricTag!, |
| 1424 | unittest.equals('foo'), |
| 1425 | ); |
| 1426 | unittest.expect( |
| 1427 | o.maxFailedTrials!, |
| 1428 | unittest.equals(42), |
| 1429 | ); |
| 1430 | unittest.expect( |
| 1431 | o.maxParallelTrials!, |
| 1432 | unittest.equals(42), |
| 1433 | ); |
| 1434 | unittest.expect( |
| 1435 | o.maxTrials!, |
| 1436 | unittest.equals(42), |
| 1437 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1438 | checkUnnamed7411(o.params!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1439 | unittest.expect( |
| 1440 | o.resumePreviousJobId!, |
| 1441 | unittest.equals('foo'), |
| 1442 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1443 | } |
| 1444 | buildCounterGoogleCloudMlV1HyperparameterSpec--; |
| 1445 | } |
| 1446 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1447 | core.int buildCounterGoogleCloudMlV1IntegratedGradientsAttribution = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1448 | api.GoogleCloudMlV1IntegratedGradientsAttribution |
| 1449 | buildGoogleCloudMlV1IntegratedGradientsAttribution() { |
| 1450 | var o = api.GoogleCloudMlV1IntegratedGradientsAttribution(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1451 | buildCounterGoogleCloudMlV1IntegratedGradientsAttribution++; |
| 1452 | if (buildCounterGoogleCloudMlV1IntegratedGradientsAttribution < 3) { |
| 1453 | o.numIntegralSteps = 42; |
| 1454 | } |
| 1455 | buildCounterGoogleCloudMlV1IntegratedGradientsAttribution--; |
| 1456 | return o; |
| 1457 | } |
| 1458 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1459 | void checkGoogleCloudMlV1IntegratedGradientsAttribution( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1460 | api.GoogleCloudMlV1IntegratedGradientsAttribution o) { |
| 1461 | buildCounterGoogleCloudMlV1IntegratedGradientsAttribution++; |
| 1462 | if (buildCounterGoogleCloudMlV1IntegratedGradientsAttribution < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1463 | unittest.expect( |
| 1464 | o.numIntegralSteps!, |
| 1465 | unittest.equals(42), |
| 1466 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1467 | } |
| 1468 | buildCounterGoogleCloudMlV1IntegratedGradientsAttribution--; |
| 1469 | } |
| 1470 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1471 | core.Map<core.String, core.String> buildUnnamed7412() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1472 | var o = <core.String, core.String>{}; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1473 | o['x'] = 'foo'; |
| 1474 | o['y'] = 'foo'; |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 1475 | return o; |
| 1476 | } |
| 1477 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1478 | void checkUnnamed7412(core.Map<core.String, core.String> o) { |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 1479 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1480 | unittest.expect( |
| 1481 | o['x']!, |
| 1482 | unittest.equals('foo'), |
| 1483 | ); |
| 1484 | unittest.expect( |
| 1485 | o['y']!, |
| 1486 | unittest.equals('foo'), |
| 1487 | ); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 1488 | } |
| 1489 | |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1490 | core.int buildCounterGoogleCloudMlV1Job = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1491 | api.GoogleCloudMlV1Job buildGoogleCloudMlV1Job() { |
| 1492 | var o = api.GoogleCloudMlV1Job(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1493 | buildCounterGoogleCloudMlV1Job++; |
| 1494 | if (buildCounterGoogleCloudMlV1Job < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1495 | o.createTime = 'foo'; |
| 1496 | o.endTime = 'foo'; |
| 1497 | o.errorMessage = 'foo'; |
| 1498 | o.etag = 'foo'; |
| 1499 | o.jobId = 'foo'; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1500 | o.labels = buildUnnamed7412(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1501 | o.predictionInput = buildGoogleCloudMlV1PredictionInput(); |
| 1502 | o.predictionOutput = buildGoogleCloudMlV1PredictionOutput(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1503 | o.startTime = 'foo'; |
| 1504 | o.state = 'foo'; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1505 | o.trainingInput = buildGoogleCloudMlV1TrainingInput(); |
| 1506 | o.trainingOutput = buildGoogleCloudMlV1TrainingOutput(); |
| 1507 | } |
| 1508 | buildCounterGoogleCloudMlV1Job--; |
| 1509 | return o; |
| 1510 | } |
| 1511 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1512 | void checkGoogleCloudMlV1Job(api.GoogleCloudMlV1Job o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1513 | buildCounterGoogleCloudMlV1Job++; |
| 1514 | if (buildCounterGoogleCloudMlV1Job < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1515 | unittest.expect( |
| 1516 | o.createTime!, |
| 1517 | unittest.equals('foo'), |
| 1518 | ); |
| 1519 | unittest.expect( |
| 1520 | o.endTime!, |
| 1521 | unittest.equals('foo'), |
| 1522 | ); |
| 1523 | unittest.expect( |
| 1524 | o.errorMessage!, |
| 1525 | unittest.equals('foo'), |
| 1526 | ); |
| 1527 | unittest.expect( |
| 1528 | o.etag!, |
| 1529 | unittest.equals('foo'), |
| 1530 | ); |
| 1531 | unittest.expect( |
| 1532 | o.jobId!, |
| 1533 | unittest.equals('foo'), |
| 1534 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1535 | checkUnnamed7412(o.labels!); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1536 | checkGoogleCloudMlV1PredictionInput( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1537 | o.predictionInput! as api.GoogleCloudMlV1PredictionInput); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1538 | checkGoogleCloudMlV1PredictionOutput( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1539 | o.predictionOutput! as api.GoogleCloudMlV1PredictionOutput); |
| 1540 | unittest.expect( |
| 1541 | o.startTime!, |
| 1542 | unittest.equals('foo'), |
| 1543 | ); |
| 1544 | unittest.expect( |
| 1545 | o.state!, |
| 1546 | unittest.equals('foo'), |
| 1547 | ); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1548 | checkGoogleCloudMlV1TrainingInput( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1549 | o.trainingInput! as api.GoogleCloudMlV1TrainingInput); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1550 | checkGoogleCloudMlV1TrainingOutput( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1551 | o.trainingOutput! as api.GoogleCloudMlV1TrainingOutput); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1552 | } |
| 1553 | buildCounterGoogleCloudMlV1Job--; |
| 1554 | } |
| 1555 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1556 | core.List<api.GoogleCloudMlV1Job> buildUnnamed7413() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1557 | var o = <api.GoogleCloudMlV1Job>[]; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1558 | o.add(buildGoogleCloudMlV1Job()); |
| 1559 | o.add(buildGoogleCloudMlV1Job()); |
| 1560 | return o; |
| 1561 | } |
| 1562 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1563 | void checkUnnamed7413(core.List<api.GoogleCloudMlV1Job> o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1564 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1565 | checkGoogleCloudMlV1Job(o[0] as api.GoogleCloudMlV1Job); |
| 1566 | checkGoogleCloudMlV1Job(o[1] as api.GoogleCloudMlV1Job); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1567 | } |
| 1568 | |
| 1569 | core.int buildCounterGoogleCloudMlV1ListJobsResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1570 | api.GoogleCloudMlV1ListJobsResponse buildGoogleCloudMlV1ListJobsResponse() { |
| 1571 | var o = api.GoogleCloudMlV1ListJobsResponse(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1572 | buildCounterGoogleCloudMlV1ListJobsResponse++; |
| 1573 | if (buildCounterGoogleCloudMlV1ListJobsResponse < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1574 | o.jobs = buildUnnamed7413(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1575 | o.nextPageToken = 'foo'; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1576 | } |
| 1577 | buildCounterGoogleCloudMlV1ListJobsResponse--; |
| 1578 | return o; |
| 1579 | } |
| 1580 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1581 | void checkGoogleCloudMlV1ListJobsResponse( |
| 1582 | api.GoogleCloudMlV1ListJobsResponse o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1583 | buildCounterGoogleCloudMlV1ListJobsResponse++; |
| 1584 | if (buildCounterGoogleCloudMlV1ListJobsResponse < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1585 | checkUnnamed7413(o.jobs!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1586 | unittest.expect( |
| 1587 | o.nextPageToken!, |
| 1588 | unittest.equals('foo'), |
| 1589 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1590 | } |
| 1591 | buildCounterGoogleCloudMlV1ListJobsResponse--; |
| 1592 | } |
| 1593 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1594 | core.List<api.GoogleCloudMlV1Location> buildUnnamed7414() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1595 | var o = <api.GoogleCloudMlV1Location>[]; |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 1596 | o.add(buildGoogleCloudMlV1Location()); |
| 1597 | o.add(buildGoogleCloudMlV1Location()); |
| 1598 | return o; |
| 1599 | } |
| 1600 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1601 | void checkUnnamed7414(core.List<api.GoogleCloudMlV1Location> o) { |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 1602 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1603 | checkGoogleCloudMlV1Location(o[0] as api.GoogleCloudMlV1Location); |
| 1604 | checkGoogleCloudMlV1Location(o[1] as api.GoogleCloudMlV1Location); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 1605 | } |
| 1606 | |
| 1607 | core.int buildCounterGoogleCloudMlV1ListLocationsResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1608 | api.GoogleCloudMlV1ListLocationsResponse |
| 1609 | buildGoogleCloudMlV1ListLocationsResponse() { |
| 1610 | var o = api.GoogleCloudMlV1ListLocationsResponse(); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 1611 | buildCounterGoogleCloudMlV1ListLocationsResponse++; |
| 1612 | if (buildCounterGoogleCloudMlV1ListLocationsResponse < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1613 | o.locations = buildUnnamed7414(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1614 | o.nextPageToken = 'foo'; |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 1615 | } |
| 1616 | buildCounterGoogleCloudMlV1ListLocationsResponse--; |
| 1617 | return o; |
| 1618 | } |
| 1619 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1620 | void checkGoogleCloudMlV1ListLocationsResponse( |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 1621 | api.GoogleCloudMlV1ListLocationsResponse o) { |
| 1622 | buildCounterGoogleCloudMlV1ListLocationsResponse++; |
| 1623 | if (buildCounterGoogleCloudMlV1ListLocationsResponse < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1624 | checkUnnamed7414(o.locations!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1625 | unittest.expect( |
| 1626 | o.nextPageToken!, |
| 1627 | unittest.equals('foo'), |
| 1628 | ); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 1629 | } |
| 1630 | buildCounterGoogleCloudMlV1ListLocationsResponse--; |
| 1631 | } |
| 1632 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1633 | core.List<api.GoogleCloudMlV1Model> buildUnnamed7415() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1634 | var o = <api.GoogleCloudMlV1Model>[]; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1635 | o.add(buildGoogleCloudMlV1Model()); |
| 1636 | o.add(buildGoogleCloudMlV1Model()); |
| 1637 | return o; |
| 1638 | } |
| 1639 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1640 | void checkUnnamed7415(core.List<api.GoogleCloudMlV1Model> o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1641 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1642 | checkGoogleCloudMlV1Model(o[0] as api.GoogleCloudMlV1Model); |
| 1643 | checkGoogleCloudMlV1Model(o[1] as api.GoogleCloudMlV1Model); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1644 | } |
| 1645 | |
| 1646 | core.int buildCounterGoogleCloudMlV1ListModelsResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1647 | api.GoogleCloudMlV1ListModelsResponse buildGoogleCloudMlV1ListModelsResponse() { |
| 1648 | var o = api.GoogleCloudMlV1ListModelsResponse(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1649 | buildCounterGoogleCloudMlV1ListModelsResponse++; |
| 1650 | if (buildCounterGoogleCloudMlV1ListModelsResponse < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1651 | o.models = buildUnnamed7415(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1652 | o.nextPageToken = 'foo'; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1653 | } |
| 1654 | buildCounterGoogleCloudMlV1ListModelsResponse--; |
| 1655 | return o; |
| 1656 | } |
| 1657 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1658 | void checkGoogleCloudMlV1ListModelsResponse( |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1659 | api.GoogleCloudMlV1ListModelsResponse o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1660 | buildCounterGoogleCloudMlV1ListModelsResponse++; |
| 1661 | if (buildCounterGoogleCloudMlV1ListModelsResponse < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1662 | checkUnnamed7415(o.models!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1663 | unittest.expect( |
| 1664 | o.nextPageToken!, |
| 1665 | unittest.equals('foo'), |
| 1666 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1667 | } |
| 1668 | buildCounterGoogleCloudMlV1ListModelsResponse--; |
| 1669 | } |
| 1670 | |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 1671 | core.int buildCounterGoogleCloudMlV1ListOptimalTrialsRequest = 0; |
| 1672 | api.GoogleCloudMlV1ListOptimalTrialsRequest |
| 1673 | buildGoogleCloudMlV1ListOptimalTrialsRequest() { |
| 1674 | var o = api.GoogleCloudMlV1ListOptimalTrialsRequest(); |
| 1675 | buildCounterGoogleCloudMlV1ListOptimalTrialsRequest++; |
| 1676 | if (buildCounterGoogleCloudMlV1ListOptimalTrialsRequest < 3) {} |
| 1677 | buildCounterGoogleCloudMlV1ListOptimalTrialsRequest--; |
| 1678 | return o; |
| 1679 | } |
| 1680 | |
| 1681 | void checkGoogleCloudMlV1ListOptimalTrialsRequest( |
| 1682 | api.GoogleCloudMlV1ListOptimalTrialsRequest o) { |
| 1683 | buildCounterGoogleCloudMlV1ListOptimalTrialsRequest++; |
| 1684 | if (buildCounterGoogleCloudMlV1ListOptimalTrialsRequest < 3) {} |
| 1685 | buildCounterGoogleCloudMlV1ListOptimalTrialsRequest--; |
| 1686 | } |
| 1687 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1688 | core.List<api.GoogleCloudMlV1Trial> buildUnnamed7416() { |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 1689 | var o = <api.GoogleCloudMlV1Trial>[]; |
| 1690 | o.add(buildGoogleCloudMlV1Trial()); |
| 1691 | o.add(buildGoogleCloudMlV1Trial()); |
| 1692 | return o; |
| 1693 | } |
| 1694 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1695 | void checkUnnamed7416(core.List<api.GoogleCloudMlV1Trial> o) { |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 1696 | unittest.expect(o, unittest.hasLength(2)); |
| 1697 | checkGoogleCloudMlV1Trial(o[0] as api.GoogleCloudMlV1Trial); |
| 1698 | checkGoogleCloudMlV1Trial(o[1] as api.GoogleCloudMlV1Trial); |
| 1699 | } |
| 1700 | |
| 1701 | core.int buildCounterGoogleCloudMlV1ListOptimalTrialsResponse = 0; |
| 1702 | api.GoogleCloudMlV1ListOptimalTrialsResponse |
| 1703 | buildGoogleCloudMlV1ListOptimalTrialsResponse() { |
| 1704 | var o = api.GoogleCloudMlV1ListOptimalTrialsResponse(); |
| 1705 | buildCounterGoogleCloudMlV1ListOptimalTrialsResponse++; |
| 1706 | if (buildCounterGoogleCloudMlV1ListOptimalTrialsResponse < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1707 | o.trials = buildUnnamed7416(); |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 1708 | } |
| 1709 | buildCounterGoogleCloudMlV1ListOptimalTrialsResponse--; |
| 1710 | return o; |
| 1711 | } |
| 1712 | |
| 1713 | void checkGoogleCloudMlV1ListOptimalTrialsResponse( |
| 1714 | api.GoogleCloudMlV1ListOptimalTrialsResponse o) { |
| 1715 | buildCounterGoogleCloudMlV1ListOptimalTrialsResponse++; |
| 1716 | if (buildCounterGoogleCloudMlV1ListOptimalTrialsResponse < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1717 | checkUnnamed7416(o.trials!); |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 1718 | } |
| 1719 | buildCounterGoogleCloudMlV1ListOptimalTrialsResponse--; |
| 1720 | } |
| 1721 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1722 | core.List<api.GoogleCloudMlV1Study> buildUnnamed7417() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1723 | var o = <api.GoogleCloudMlV1Study>[]; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1724 | o.add(buildGoogleCloudMlV1Study()); |
| 1725 | o.add(buildGoogleCloudMlV1Study()); |
| 1726 | return o; |
| 1727 | } |
| 1728 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1729 | void checkUnnamed7417(core.List<api.GoogleCloudMlV1Study> o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1730 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1731 | checkGoogleCloudMlV1Study(o[0] as api.GoogleCloudMlV1Study); |
| 1732 | checkGoogleCloudMlV1Study(o[1] as api.GoogleCloudMlV1Study); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1733 | } |
| 1734 | |
| 1735 | core.int buildCounterGoogleCloudMlV1ListStudiesResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1736 | api.GoogleCloudMlV1ListStudiesResponse |
| 1737 | buildGoogleCloudMlV1ListStudiesResponse() { |
| 1738 | var o = api.GoogleCloudMlV1ListStudiesResponse(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1739 | buildCounterGoogleCloudMlV1ListStudiesResponse++; |
| 1740 | if (buildCounterGoogleCloudMlV1ListStudiesResponse < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1741 | o.studies = buildUnnamed7417(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1742 | } |
| 1743 | buildCounterGoogleCloudMlV1ListStudiesResponse--; |
| 1744 | return o; |
| 1745 | } |
| 1746 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1747 | void checkGoogleCloudMlV1ListStudiesResponse( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1748 | api.GoogleCloudMlV1ListStudiesResponse o) { |
| 1749 | buildCounterGoogleCloudMlV1ListStudiesResponse++; |
| 1750 | if (buildCounterGoogleCloudMlV1ListStudiesResponse < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1751 | checkUnnamed7417(o.studies!); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1752 | } |
| 1753 | buildCounterGoogleCloudMlV1ListStudiesResponse--; |
| 1754 | } |
| 1755 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1756 | core.List<api.GoogleCloudMlV1Trial> buildUnnamed7418() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1757 | var o = <api.GoogleCloudMlV1Trial>[]; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1758 | o.add(buildGoogleCloudMlV1Trial()); |
| 1759 | o.add(buildGoogleCloudMlV1Trial()); |
| 1760 | return o; |
| 1761 | } |
| 1762 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1763 | void checkUnnamed7418(core.List<api.GoogleCloudMlV1Trial> o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1764 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1765 | checkGoogleCloudMlV1Trial(o[0] as api.GoogleCloudMlV1Trial); |
| 1766 | checkGoogleCloudMlV1Trial(o[1] as api.GoogleCloudMlV1Trial); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1767 | } |
| 1768 | |
| 1769 | core.int buildCounterGoogleCloudMlV1ListTrialsResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1770 | api.GoogleCloudMlV1ListTrialsResponse buildGoogleCloudMlV1ListTrialsResponse() { |
| 1771 | var o = api.GoogleCloudMlV1ListTrialsResponse(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1772 | buildCounterGoogleCloudMlV1ListTrialsResponse++; |
| 1773 | if (buildCounterGoogleCloudMlV1ListTrialsResponse < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1774 | o.trials = buildUnnamed7418(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1775 | } |
| 1776 | buildCounterGoogleCloudMlV1ListTrialsResponse--; |
| 1777 | return o; |
| 1778 | } |
| 1779 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1780 | void checkGoogleCloudMlV1ListTrialsResponse( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1781 | api.GoogleCloudMlV1ListTrialsResponse o) { |
| 1782 | buildCounterGoogleCloudMlV1ListTrialsResponse++; |
| 1783 | if (buildCounterGoogleCloudMlV1ListTrialsResponse < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1784 | checkUnnamed7418(o.trials!); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1785 | } |
| 1786 | buildCounterGoogleCloudMlV1ListTrialsResponse--; |
| 1787 | } |
| 1788 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1789 | core.List<api.GoogleCloudMlV1Version> buildUnnamed7419() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1790 | var o = <api.GoogleCloudMlV1Version>[]; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1791 | o.add(buildGoogleCloudMlV1Version()); |
| 1792 | o.add(buildGoogleCloudMlV1Version()); |
| 1793 | return o; |
| 1794 | } |
| 1795 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1796 | void checkUnnamed7419(core.List<api.GoogleCloudMlV1Version> o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1797 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1798 | checkGoogleCloudMlV1Version(o[0] as api.GoogleCloudMlV1Version); |
| 1799 | checkGoogleCloudMlV1Version(o[1] as api.GoogleCloudMlV1Version); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1800 | } |
| 1801 | |
| 1802 | core.int buildCounterGoogleCloudMlV1ListVersionsResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1803 | api.GoogleCloudMlV1ListVersionsResponse |
| 1804 | buildGoogleCloudMlV1ListVersionsResponse() { |
| 1805 | var o = api.GoogleCloudMlV1ListVersionsResponse(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1806 | buildCounterGoogleCloudMlV1ListVersionsResponse++; |
| 1807 | if (buildCounterGoogleCloudMlV1ListVersionsResponse < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1808 | o.nextPageToken = 'foo'; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1809 | o.versions = buildUnnamed7419(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1810 | } |
| 1811 | buildCounterGoogleCloudMlV1ListVersionsResponse--; |
| 1812 | return o; |
| 1813 | } |
| 1814 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1815 | void checkGoogleCloudMlV1ListVersionsResponse( |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1816 | api.GoogleCloudMlV1ListVersionsResponse o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1817 | buildCounterGoogleCloudMlV1ListVersionsResponse++; |
| 1818 | if (buildCounterGoogleCloudMlV1ListVersionsResponse < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1819 | unittest.expect( |
| 1820 | o.nextPageToken!, |
| 1821 | unittest.equals('foo'), |
| 1822 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1823 | checkUnnamed7419(o.versions!); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1824 | } |
| 1825 | buildCounterGoogleCloudMlV1ListVersionsResponse--; |
| 1826 | } |
| 1827 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1828 | core.List<api.GoogleCloudMlV1Capability> buildUnnamed7420() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1829 | var o = <api.GoogleCloudMlV1Capability>[]; |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 1830 | o.add(buildGoogleCloudMlV1Capability()); |
| 1831 | o.add(buildGoogleCloudMlV1Capability()); |
| 1832 | return o; |
| 1833 | } |
| 1834 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1835 | void checkUnnamed7420(core.List<api.GoogleCloudMlV1Capability> o) { |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 1836 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1837 | checkGoogleCloudMlV1Capability(o[0] as api.GoogleCloudMlV1Capability); |
| 1838 | checkGoogleCloudMlV1Capability(o[1] as api.GoogleCloudMlV1Capability); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 1839 | } |
| 1840 | |
| 1841 | core.int buildCounterGoogleCloudMlV1Location = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1842 | api.GoogleCloudMlV1Location buildGoogleCloudMlV1Location() { |
| 1843 | var o = api.GoogleCloudMlV1Location(); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 1844 | buildCounterGoogleCloudMlV1Location++; |
| 1845 | if (buildCounterGoogleCloudMlV1Location < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1846 | o.capabilities = buildUnnamed7420(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1847 | o.name = 'foo'; |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 1848 | } |
| 1849 | buildCounterGoogleCloudMlV1Location--; |
| 1850 | return o; |
| 1851 | } |
| 1852 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1853 | void checkGoogleCloudMlV1Location(api.GoogleCloudMlV1Location o) { |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 1854 | buildCounterGoogleCloudMlV1Location++; |
| 1855 | if (buildCounterGoogleCloudMlV1Location < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1856 | checkUnnamed7420(o.capabilities!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1857 | unittest.expect( |
| 1858 | o.name!, |
| 1859 | unittest.equals('foo'), |
| 1860 | ); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 1861 | } |
| 1862 | buildCounterGoogleCloudMlV1Location--; |
| 1863 | } |
| 1864 | |
Martin Kustermann | 77f42ff | 2017-03-06 13:56:35 +0100 | [diff] [blame] | 1865 | core.int buildCounterGoogleCloudMlV1ManualScaling = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1866 | api.GoogleCloudMlV1ManualScaling buildGoogleCloudMlV1ManualScaling() { |
| 1867 | var o = api.GoogleCloudMlV1ManualScaling(); |
Martin Kustermann | 77f42ff | 2017-03-06 13:56:35 +0100 | [diff] [blame] | 1868 | buildCounterGoogleCloudMlV1ManualScaling++; |
| 1869 | if (buildCounterGoogleCloudMlV1ManualScaling < 3) { |
| 1870 | o.nodes = 42; |
| 1871 | } |
| 1872 | buildCounterGoogleCloudMlV1ManualScaling--; |
| 1873 | return o; |
| 1874 | } |
| 1875 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1876 | void checkGoogleCloudMlV1ManualScaling(api.GoogleCloudMlV1ManualScaling o) { |
Martin Kustermann | 77f42ff | 2017-03-06 13:56:35 +0100 | [diff] [blame] | 1877 | buildCounterGoogleCloudMlV1ManualScaling++; |
| 1878 | if (buildCounterGoogleCloudMlV1ManualScaling < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1879 | unittest.expect( |
| 1880 | o.nodes!, |
| 1881 | unittest.equals(42), |
| 1882 | ); |
Martin Kustermann | 77f42ff | 2017-03-06 13:56:35 +0100 | [diff] [blame] | 1883 | } |
| 1884 | buildCounterGoogleCloudMlV1ManualScaling--; |
| 1885 | } |
| 1886 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1887 | core.List<api.GoogleCloudMlV1MeasurementMetric> buildUnnamed7421() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1888 | var o = <api.GoogleCloudMlV1MeasurementMetric>[]; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1889 | o.add(buildGoogleCloudMlV1MeasurementMetric()); |
| 1890 | o.add(buildGoogleCloudMlV1MeasurementMetric()); |
| 1891 | return o; |
| 1892 | } |
| 1893 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1894 | void checkUnnamed7421(core.List<api.GoogleCloudMlV1MeasurementMetric> o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1895 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1896 | checkGoogleCloudMlV1MeasurementMetric( |
| 1897 | o[0] as api.GoogleCloudMlV1MeasurementMetric); |
| 1898 | checkGoogleCloudMlV1MeasurementMetric( |
| 1899 | o[1] as api.GoogleCloudMlV1MeasurementMetric); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1900 | } |
| 1901 | |
| 1902 | core.int buildCounterGoogleCloudMlV1Measurement = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1903 | api.GoogleCloudMlV1Measurement buildGoogleCloudMlV1Measurement() { |
| 1904 | var o = api.GoogleCloudMlV1Measurement(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1905 | buildCounterGoogleCloudMlV1Measurement++; |
| 1906 | if (buildCounterGoogleCloudMlV1Measurement < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1907 | o.elapsedTime = 'foo'; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1908 | o.metrics = buildUnnamed7421(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1909 | o.stepCount = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1910 | } |
| 1911 | buildCounterGoogleCloudMlV1Measurement--; |
| 1912 | return o; |
| 1913 | } |
| 1914 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1915 | void checkGoogleCloudMlV1Measurement(api.GoogleCloudMlV1Measurement o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1916 | buildCounterGoogleCloudMlV1Measurement++; |
| 1917 | if (buildCounterGoogleCloudMlV1Measurement < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1918 | unittest.expect( |
| 1919 | o.elapsedTime!, |
| 1920 | unittest.equals('foo'), |
| 1921 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1922 | checkUnnamed7421(o.metrics!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1923 | unittest.expect( |
| 1924 | o.stepCount!, |
| 1925 | unittest.equals('foo'), |
| 1926 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1927 | } |
| 1928 | buildCounterGoogleCloudMlV1Measurement--; |
| 1929 | } |
| 1930 | |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 1931 | core.int buildCounterGoogleCloudMlV1MetricSpec = 0; |
| 1932 | api.GoogleCloudMlV1MetricSpec buildGoogleCloudMlV1MetricSpec() { |
| 1933 | var o = api.GoogleCloudMlV1MetricSpec(); |
| 1934 | buildCounterGoogleCloudMlV1MetricSpec++; |
| 1935 | if (buildCounterGoogleCloudMlV1MetricSpec < 3) { |
| 1936 | o.name = 'foo'; |
| 1937 | o.target = 42; |
| 1938 | } |
| 1939 | buildCounterGoogleCloudMlV1MetricSpec--; |
| 1940 | return o; |
| 1941 | } |
| 1942 | |
| 1943 | void checkGoogleCloudMlV1MetricSpec(api.GoogleCloudMlV1MetricSpec o) { |
| 1944 | buildCounterGoogleCloudMlV1MetricSpec++; |
| 1945 | if (buildCounterGoogleCloudMlV1MetricSpec < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1946 | unittest.expect( |
| 1947 | o.name!, |
| 1948 | unittest.equals('foo'), |
| 1949 | ); |
| 1950 | unittest.expect( |
| 1951 | o.target!, |
| 1952 | unittest.equals(42), |
| 1953 | ); |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 1954 | } |
| 1955 | buildCounterGoogleCloudMlV1MetricSpec--; |
| 1956 | } |
| 1957 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1958 | core.Map<core.String, core.String> buildUnnamed7422() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1959 | var o = <core.String, core.String>{}; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1960 | o['x'] = 'foo'; |
| 1961 | o['y'] = 'foo'; |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 1962 | return o; |
| 1963 | } |
| 1964 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1965 | void checkUnnamed7422(core.Map<core.String, core.String> o) { |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 1966 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1967 | unittest.expect( |
| 1968 | o['x']!, |
| 1969 | unittest.equals('foo'), |
| 1970 | ); |
| 1971 | unittest.expect( |
| 1972 | o['y']!, |
| 1973 | unittest.equals('foo'), |
| 1974 | ); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 1975 | } |
| 1976 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1977 | core.List<core.String> buildUnnamed7423() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1978 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1979 | o.add('foo'); |
| 1980 | o.add('foo'); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1981 | return o; |
| 1982 | } |
| 1983 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 1984 | void checkUnnamed7423(core.List<core.String> o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1985 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1986 | unittest.expect( |
| 1987 | o[0], |
| 1988 | unittest.equals('foo'), |
| 1989 | ); |
| 1990 | unittest.expect( |
| 1991 | o[1], |
| 1992 | unittest.equals('foo'), |
| 1993 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1994 | } |
| 1995 | |
| 1996 | core.int buildCounterGoogleCloudMlV1Model = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1997 | api.GoogleCloudMlV1Model buildGoogleCloudMlV1Model() { |
| 1998 | var o = api.GoogleCloudMlV1Model(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 1999 | buildCounterGoogleCloudMlV1Model++; |
| 2000 | if (buildCounterGoogleCloudMlV1Model < 3) { |
| 2001 | o.defaultVersion = buildGoogleCloudMlV1Version(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2002 | o.description = 'foo'; |
| 2003 | o.etag = 'foo'; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2004 | o.labels = buildUnnamed7422(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2005 | o.name = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 2006 | o.onlinePredictionConsoleLogging = true; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2007 | o.onlinePredictionLogging = true; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2008 | o.regions = buildUnnamed7423(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2009 | } |
| 2010 | buildCounterGoogleCloudMlV1Model--; |
| 2011 | return o; |
| 2012 | } |
| 2013 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2014 | void checkGoogleCloudMlV1Model(api.GoogleCloudMlV1Model o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2015 | buildCounterGoogleCloudMlV1Model++; |
| 2016 | if (buildCounterGoogleCloudMlV1Model < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2017 | checkGoogleCloudMlV1Version( |
| 2018 | o.defaultVersion! as api.GoogleCloudMlV1Version); |
| 2019 | unittest.expect( |
| 2020 | o.description!, |
| 2021 | unittest.equals('foo'), |
| 2022 | ); |
| 2023 | unittest.expect( |
| 2024 | o.etag!, |
| 2025 | unittest.equals('foo'), |
| 2026 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2027 | checkUnnamed7422(o.labels!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2028 | unittest.expect( |
| 2029 | o.name!, |
| 2030 | unittest.equals('foo'), |
| 2031 | ); |
| 2032 | unittest.expect(o.onlinePredictionConsoleLogging!, unittest.isTrue); |
| 2033 | unittest.expect(o.onlinePredictionLogging!, unittest.isTrue); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2034 | checkUnnamed7423(o.regions!); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2035 | } |
| 2036 | buildCounterGoogleCloudMlV1Model--; |
| 2037 | } |
| 2038 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2039 | core.Map<core.String, core.String> buildUnnamed7424() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2040 | var o = <core.String, core.String>{}; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2041 | o['x'] = 'foo'; |
| 2042 | o['y'] = 'foo'; |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 2043 | return o; |
| 2044 | } |
| 2045 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2046 | void checkUnnamed7424(core.Map<core.String, core.String> o) { |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 2047 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2048 | unittest.expect( |
| 2049 | o['x']!, |
| 2050 | unittest.equals('foo'), |
| 2051 | ); |
| 2052 | unittest.expect( |
| 2053 | o['y']!, |
| 2054 | unittest.equals('foo'), |
| 2055 | ); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 2056 | } |
| 2057 | |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 2058 | core.int buildCounterGoogleCloudMlV1OperationMetadata = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2059 | api.GoogleCloudMlV1OperationMetadata buildGoogleCloudMlV1OperationMetadata() { |
| 2060 | var o = api.GoogleCloudMlV1OperationMetadata(); |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 2061 | buildCounterGoogleCloudMlV1OperationMetadata++; |
| 2062 | if (buildCounterGoogleCloudMlV1OperationMetadata < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2063 | o.createTime = 'foo'; |
| 2064 | o.endTime = 'foo'; |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 2065 | o.isCancellationRequested = true; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2066 | o.labels = buildUnnamed7424(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2067 | o.modelName = 'foo'; |
| 2068 | o.operationType = 'foo'; |
| 2069 | o.projectNumber = 'foo'; |
| 2070 | o.startTime = 'foo'; |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 2071 | o.version = buildGoogleCloudMlV1Version(); |
| 2072 | } |
| 2073 | buildCounterGoogleCloudMlV1OperationMetadata--; |
| 2074 | return o; |
| 2075 | } |
| 2076 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2077 | void checkGoogleCloudMlV1OperationMetadata( |
| 2078 | api.GoogleCloudMlV1OperationMetadata o) { |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 2079 | buildCounterGoogleCloudMlV1OperationMetadata++; |
| 2080 | if (buildCounterGoogleCloudMlV1OperationMetadata < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2081 | unittest.expect( |
| 2082 | o.createTime!, |
| 2083 | unittest.equals('foo'), |
| 2084 | ); |
| 2085 | unittest.expect( |
| 2086 | o.endTime!, |
| 2087 | unittest.equals('foo'), |
| 2088 | ); |
| 2089 | unittest.expect(o.isCancellationRequested!, unittest.isTrue); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2090 | checkUnnamed7424(o.labels!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2091 | unittest.expect( |
| 2092 | o.modelName!, |
| 2093 | unittest.equals('foo'), |
| 2094 | ); |
| 2095 | unittest.expect( |
| 2096 | o.operationType!, |
| 2097 | unittest.equals('foo'), |
| 2098 | ); |
| 2099 | unittest.expect( |
| 2100 | o.projectNumber!, |
| 2101 | unittest.equals('foo'), |
| 2102 | ); |
| 2103 | unittest.expect( |
| 2104 | o.startTime!, |
| 2105 | unittest.equals('foo'), |
| 2106 | ); |
| 2107 | checkGoogleCloudMlV1Version(o.version! as api.GoogleCloudMlV1Version); |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 2108 | } |
| 2109 | buildCounterGoogleCloudMlV1OperationMetadata--; |
| 2110 | } |
| 2111 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2112 | core.List<core.String> buildUnnamed7425() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2113 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2114 | o.add('foo'); |
| 2115 | o.add('foo'); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2116 | return o; |
| 2117 | } |
| 2118 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2119 | void checkUnnamed7425(core.List<core.String> o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2120 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2121 | unittest.expect( |
| 2122 | o[0], |
| 2123 | unittest.equals('foo'), |
| 2124 | ); |
| 2125 | unittest.expect( |
| 2126 | o[1], |
| 2127 | unittest.equals('foo'), |
| 2128 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2129 | } |
| 2130 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2131 | core.List<core.double> buildUnnamed7426() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2132 | var o = <core.double>[]; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2133 | o.add(42.0); |
| 2134 | o.add(42.0); |
| 2135 | return o; |
| 2136 | } |
| 2137 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2138 | void checkUnnamed7426(core.List<core.double> o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2139 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2140 | unittest.expect( |
| 2141 | o[0], |
| 2142 | unittest.equals(42.0), |
| 2143 | ); |
| 2144 | unittest.expect( |
| 2145 | o[1], |
| 2146 | unittest.equals(42.0), |
| 2147 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2148 | } |
| 2149 | |
| 2150 | core.int buildCounterGoogleCloudMlV1ParameterSpec = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2151 | api.GoogleCloudMlV1ParameterSpec buildGoogleCloudMlV1ParameterSpec() { |
| 2152 | var o = api.GoogleCloudMlV1ParameterSpec(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2153 | buildCounterGoogleCloudMlV1ParameterSpec++; |
| 2154 | if (buildCounterGoogleCloudMlV1ParameterSpec < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2155 | o.categoricalValues = buildUnnamed7425(); |
| 2156 | o.discreteValues = buildUnnamed7426(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2157 | o.maxValue = 42.0; |
| 2158 | o.minValue = 42.0; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2159 | o.parameterName = 'foo'; |
| 2160 | o.scaleType = 'foo'; |
| 2161 | o.type = 'foo'; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2162 | } |
| 2163 | buildCounterGoogleCloudMlV1ParameterSpec--; |
| 2164 | return o; |
| 2165 | } |
| 2166 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2167 | void checkGoogleCloudMlV1ParameterSpec(api.GoogleCloudMlV1ParameterSpec o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2168 | buildCounterGoogleCloudMlV1ParameterSpec++; |
| 2169 | if (buildCounterGoogleCloudMlV1ParameterSpec < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2170 | checkUnnamed7425(o.categoricalValues!); |
| 2171 | checkUnnamed7426(o.discreteValues!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2172 | unittest.expect( |
| 2173 | o.maxValue!, |
| 2174 | unittest.equals(42.0), |
| 2175 | ); |
| 2176 | unittest.expect( |
| 2177 | o.minValue!, |
| 2178 | unittest.equals(42.0), |
| 2179 | ); |
| 2180 | unittest.expect( |
| 2181 | o.parameterName!, |
| 2182 | unittest.equals('foo'), |
| 2183 | ); |
| 2184 | unittest.expect( |
| 2185 | o.scaleType!, |
| 2186 | unittest.equals('foo'), |
| 2187 | ); |
| 2188 | unittest.expect( |
| 2189 | o.type!, |
| 2190 | unittest.equals('foo'), |
| 2191 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2192 | } |
| 2193 | buildCounterGoogleCloudMlV1ParameterSpec--; |
| 2194 | } |
| 2195 | |
| 2196 | core.int buildCounterGoogleCloudMlV1PredictRequest = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2197 | api.GoogleCloudMlV1PredictRequest buildGoogleCloudMlV1PredictRequest() { |
| 2198 | var o = api.GoogleCloudMlV1PredictRequest(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2199 | buildCounterGoogleCloudMlV1PredictRequest++; |
| 2200 | if (buildCounterGoogleCloudMlV1PredictRequest < 3) { |
| 2201 | o.httpBody = buildGoogleApiHttpBody(); |
| 2202 | } |
| 2203 | buildCounterGoogleCloudMlV1PredictRequest--; |
| 2204 | return o; |
| 2205 | } |
| 2206 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2207 | void checkGoogleCloudMlV1PredictRequest(api.GoogleCloudMlV1PredictRequest o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2208 | buildCounterGoogleCloudMlV1PredictRequest++; |
| 2209 | if (buildCounterGoogleCloudMlV1PredictRequest < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2210 | checkGoogleApiHttpBody(o.httpBody! as api.GoogleApiHttpBody); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2211 | } |
| 2212 | buildCounterGoogleCloudMlV1PredictRequest--; |
| 2213 | } |
| 2214 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2215 | core.List<core.String> buildUnnamed7427() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2216 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2217 | o.add('foo'); |
| 2218 | o.add('foo'); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2219 | return o; |
| 2220 | } |
| 2221 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2222 | void checkUnnamed7427(core.List<core.String> o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2223 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2224 | unittest.expect( |
| 2225 | o[0], |
| 2226 | unittest.equals('foo'), |
| 2227 | ); |
| 2228 | unittest.expect( |
| 2229 | o[1], |
| 2230 | unittest.equals('foo'), |
| 2231 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2232 | } |
| 2233 | |
| 2234 | core.int buildCounterGoogleCloudMlV1PredictionInput = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2235 | api.GoogleCloudMlV1PredictionInput buildGoogleCloudMlV1PredictionInput() { |
| 2236 | var o = api.GoogleCloudMlV1PredictionInput(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2237 | buildCounterGoogleCloudMlV1PredictionInput++; |
| 2238 | if (buildCounterGoogleCloudMlV1PredictionInput < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2239 | o.batchSize = 'foo'; |
| 2240 | o.dataFormat = 'foo'; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2241 | o.inputPaths = buildUnnamed7427(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2242 | o.maxWorkerCount = 'foo'; |
| 2243 | o.modelName = 'foo'; |
| 2244 | o.outputDataFormat = 'foo'; |
| 2245 | o.outputPath = 'foo'; |
| 2246 | o.region = 'foo'; |
| 2247 | o.runtimeVersion = 'foo'; |
| 2248 | o.signatureName = 'foo'; |
| 2249 | o.uri = 'foo'; |
| 2250 | o.versionName = 'foo'; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2251 | } |
| 2252 | buildCounterGoogleCloudMlV1PredictionInput--; |
| 2253 | return o; |
| 2254 | } |
| 2255 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2256 | void checkGoogleCloudMlV1PredictionInput(api.GoogleCloudMlV1PredictionInput o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2257 | buildCounterGoogleCloudMlV1PredictionInput++; |
| 2258 | if (buildCounterGoogleCloudMlV1PredictionInput < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2259 | unittest.expect( |
| 2260 | o.batchSize!, |
| 2261 | unittest.equals('foo'), |
| 2262 | ); |
| 2263 | unittest.expect( |
| 2264 | o.dataFormat!, |
| 2265 | unittest.equals('foo'), |
| 2266 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2267 | checkUnnamed7427(o.inputPaths!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2268 | unittest.expect( |
| 2269 | o.maxWorkerCount!, |
| 2270 | unittest.equals('foo'), |
| 2271 | ); |
| 2272 | unittest.expect( |
| 2273 | o.modelName!, |
| 2274 | unittest.equals('foo'), |
| 2275 | ); |
| 2276 | unittest.expect( |
| 2277 | o.outputDataFormat!, |
| 2278 | unittest.equals('foo'), |
| 2279 | ); |
| 2280 | unittest.expect( |
| 2281 | o.outputPath!, |
| 2282 | unittest.equals('foo'), |
| 2283 | ); |
| 2284 | unittest.expect( |
| 2285 | o.region!, |
| 2286 | unittest.equals('foo'), |
| 2287 | ); |
| 2288 | unittest.expect( |
| 2289 | o.runtimeVersion!, |
| 2290 | unittest.equals('foo'), |
| 2291 | ); |
| 2292 | unittest.expect( |
| 2293 | o.signatureName!, |
| 2294 | unittest.equals('foo'), |
| 2295 | ); |
| 2296 | unittest.expect( |
| 2297 | o.uri!, |
| 2298 | unittest.equals('foo'), |
| 2299 | ); |
| 2300 | unittest.expect( |
| 2301 | o.versionName!, |
| 2302 | unittest.equals('foo'), |
| 2303 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2304 | } |
| 2305 | buildCounterGoogleCloudMlV1PredictionInput--; |
| 2306 | } |
| 2307 | |
| 2308 | core.int buildCounterGoogleCloudMlV1PredictionOutput = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2309 | api.GoogleCloudMlV1PredictionOutput buildGoogleCloudMlV1PredictionOutput() { |
| 2310 | var o = api.GoogleCloudMlV1PredictionOutput(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2311 | buildCounterGoogleCloudMlV1PredictionOutput++; |
| 2312 | if (buildCounterGoogleCloudMlV1PredictionOutput < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2313 | o.errorCount = 'foo'; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2314 | o.nodeHours = 42.0; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2315 | o.outputPath = 'foo'; |
| 2316 | o.predictionCount = 'foo'; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2317 | } |
| 2318 | buildCounterGoogleCloudMlV1PredictionOutput--; |
| 2319 | return o; |
| 2320 | } |
| 2321 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2322 | void checkGoogleCloudMlV1PredictionOutput( |
| 2323 | api.GoogleCloudMlV1PredictionOutput o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2324 | buildCounterGoogleCloudMlV1PredictionOutput++; |
| 2325 | if (buildCounterGoogleCloudMlV1PredictionOutput < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2326 | unittest.expect( |
| 2327 | o.errorCount!, |
| 2328 | unittest.equals('foo'), |
| 2329 | ); |
| 2330 | unittest.expect( |
| 2331 | o.nodeHours!, |
| 2332 | unittest.equals(42.0), |
| 2333 | ); |
| 2334 | unittest.expect( |
| 2335 | o.outputPath!, |
| 2336 | unittest.equals('foo'), |
| 2337 | ); |
| 2338 | unittest.expect( |
| 2339 | o.predictionCount!, |
| 2340 | unittest.equals('foo'), |
| 2341 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2342 | } |
| 2343 | buildCounterGoogleCloudMlV1PredictionOutput--; |
| 2344 | } |
| 2345 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2346 | core.List<core.String> buildUnnamed7428() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2347 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2348 | o.add('foo'); |
| 2349 | o.add('foo'); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 2350 | return o; |
| 2351 | } |
| 2352 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2353 | void checkUnnamed7428(core.List<core.String> o) { |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 2354 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2355 | unittest.expect( |
| 2356 | o[0], |
| 2357 | unittest.equals('foo'), |
| 2358 | ); |
| 2359 | unittest.expect( |
| 2360 | o[1], |
| 2361 | unittest.equals('foo'), |
| 2362 | ); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 2363 | } |
| 2364 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2365 | core.List<core.String> buildUnnamed7429() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2366 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2367 | o.add('foo'); |
| 2368 | o.add('foo'); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 2369 | return o; |
| 2370 | } |
| 2371 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2372 | void checkUnnamed7429(core.List<core.String> o) { |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 2373 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2374 | unittest.expect( |
| 2375 | o[0], |
| 2376 | unittest.equals('foo'), |
| 2377 | ); |
| 2378 | unittest.expect( |
| 2379 | o[1], |
| 2380 | unittest.equals('foo'), |
| 2381 | ); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 2382 | } |
| 2383 | |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 2384 | core.int buildCounterGoogleCloudMlV1ReplicaConfig = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2385 | api.GoogleCloudMlV1ReplicaConfig buildGoogleCloudMlV1ReplicaConfig() { |
| 2386 | var o = api.GoogleCloudMlV1ReplicaConfig(); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 2387 | buildCounterGoogleCloudMlV1ReplicaConfig++; |
| 2388 | if (buildCounterGoogleCloudMlV1ReplicaConfig < 3) { |
| 2389 | o.acceleratorConfig = buildGoogleCloudMlV1AcceleratorConfig(); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2390 | o.containerArgs = buildUnnamed7428(); |
| 2391 | o.containerCommand = buildUnnamed7429(); |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 2392 | o.diskConfig = buildGoogleCloudMlV1DiskConfig(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2393 | o.imageUri = 'foo'; |
| 2394 | o.tpuTfVersion = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 2395 | } |
| 2396 | buildCounterGoogleCloudMlV1ReplicaConfig--; |
| 2397 | return o; |
| 2398 | } |
| 2399 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2400 | void checkGoogleCloudMlV1ReplicaConfig(api.GoogleCloudMlV1ReplicaConfig o) { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 2401 | buildCounterGoogleCloudMlV1ReplicaConfig++; |
| 2402 | if (buildCounterGoogleCloudMlV1ReplicaConfig < 3) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 2403 | checkGoogleCloudMlV1AcceleratorConfig( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2404 | o.acceleratorConfig! as api.GoogleCloudMlV1AcceleratorConfig); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2405 | checkUnnamed7428(o.containerArgs!); |
| 2406 | checkUnnamed7429(o.containerCommand!); |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 2407 | checkGoogleCloudMlV1DiskConfig( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2408 | o.diskConfig! as api.GoogleCloudMlV1DiskConfig); |
| 2409 | unittest.expect( |
| 2410 | o.imageUri!, |
| 2411 | unittest.equals('foo'), |
| 2412 | ); |
| 2413 | unittest.expect( |
| 2414 | o.tpuTfVersion!, |
| 2415 | unittest.equals('foo'), |
| 2416 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 2417 | } |
| 2418 | buildCounterGoogleCloudMlV1ReplicaConfig--; |
| 2419 | } |
| 2420 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2421 | core.int buildCounterGoogleCloudMlV1RequestLoggingConfig = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2422 | api.GoogleCloudMlV1RequestLoggingConfig |
| 2423 | buildGoogleCloudMlV1RequestLoggingConfig() { |
| 2424 | var o = api.GoogleCloudMlV1RequestLoggingConfig(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2425 | buildCounterGoogleCloudMlV1RequestLoggingConfig++; |
| 2426 | if (buildCounterGoogleCloudMlV1RequestLoggingConfig < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2427 | o.bigqueryTableName = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2428 | o.samplingPercentage = 42.0; |
| 2429 | } |
| 2430 | buildCounterGoogleCloudMlV1RequestLoggingConfig--; |
| 2431 | return o; |
| 2432 | } |
| 2433 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2434 | void checkGoogleCloudMlV1RequestLoggingConfig( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2435 | api.GoogleCloudMlV1RequestLoggingConfig o) { |
| 2436 | buildCounterGoogleCloudMlV1RequestLoggingConfig++; |
| 2437 | if (buildCounterGoogleCloudMlV1RequestLoggingConfig < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2438 | unittest.expect( |
| 2439 | o.bigqueryTableName!, |
| 2440 | unittest.equals('foo'), |
| 2441 | ); |
| 2442 | unittest.expect( |
| 2443 | o.samplingPercentage!, |
| 2444 | unittest.equals(42.0), |
| 2445 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2446 | } |
| 2447 | buildCounterGoogleCloudMlV1RequestLoggingConfig--; |
| 2448 | } |
| 2449 | |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 2450 | core.int buildCounterGoogleCloudMlV1RouteMap = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2451 | api.GoogleCloudMlV1RouteMap buildGoogleCloudMlV1RouteMap() { |
| 2452 | var o = api.GoogleCloudMlV1RouteMap(); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 2453 | buildCounterGoogleCloudMlV1RouteMap++; |
| 2454 | if (buildCounterGoogleCloudMlV1RouteMap < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2455 | o.health = 'foo'; |
| 2456 | o.predict = 'foo'; |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 2457 | } |
| 2458 | buildCounterGoogleCloudMlV1RouteMap--; |
| 2459 | return o; |
| 2460 | } |
| 2461 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2462 | void checkGoogleCloudMlV1RouteMap(api.GoogleCloudMlV1RouteMap o) { |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 2463 | buildCounterGoogleCloudMlV1RouteMap++; |
| 2464 | if (buildCounterGoogleCloudMlV1RouteMap < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2465 | unittest.expect( |
| 2466 | o.health!, |
| 2467 | unittest.equals('foo'), |
| 2468 | ); |
| 2469 | unittest.expect( |
| 2470 | o.predict!, |
| 2471 | unittest.equals('foo'), |
| 2472 | ); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 2473 | } |
| 2474 | buildCounterGoogleCloudMlV1RouteMap--; |
| 2475 | } |
| 2476 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2477 | core.int buildCounterGoogleCloudMlV1SampledShapleyAttribution = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2478 | api.GoogleCloudMlV1SampledShapleyAttribution |
| 2479 | buildGoogleCloudMlV1SampledShapleyAttribution() { |
| 2480 | var o = api.GoogleCloudMlV1SampledShapleyAttribution(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2481 | buildCounterGoogleCloudMlV1SampledShapleyAttribution++; |
| 2482 | if (buildCounterGoogleCloudMlV1SampledShapleyAttribution < 3) { |
| 2483 | o.numPaths = 42; |
| 2484 | } |
| 2485 | buildCounterGoogleCloudMlV1SampledShapleyAttribution--; |
| 2486 | return o; |
| 2487 | } |
| 2488 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2489 | void checkGoogleCloudMlV1SampledShapleyAttribution( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2490 | api.GoogleCloudMlV1SampledShapleyAttribution o) { |
| 2491 | buildCounterGoogleCloudMlV1SampledShapleyAttribution++; |
| 2492 | if (buildCounterGoogleCloudMlV1SampledShapleyAttribution < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2493 | unittest.expect( |
| 2494 | o.numPaths!, |
| 2495 | unittest.equals(42), |
| 2496 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2497 | } |
| 2498 | buildCounterGoogleCloudMlV1SampledShapleyAttribution--; |
| 2499 | } |
| 2500 | |
| 2501 | core.int buildCounterGoogleCloudMlV1Scheduling = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2502 | api.GoogleCloudMlV1Scheduling buildGoogleCloudMlV1Scheduling() { |
| 2503 | var o = api.GoogleCloudMlV1Scheduling(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2504 | buildCounterGoogleCloudMlV1Scheduling++; |
| 2505 | if (buildCounterGoogleCloudMlV1Scheduling < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2506 | o.maxRunningTime = 'foo'; |
| 2507 | o.maxWaitTime = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2508 | } |
| 2509 | buildCounterGoogleCloudMlV1Scheduling--; |
| 2510 | return o; |
| 2511 | } |
| 2512 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2513 | void checkGoogleCloudMlV1Scheduling(api.GoogleCloudMlV1Scheduling o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2514 | buildCounterGoogleCloudMlV1Scheduling++; |
| 2515 | if (buildCounterGoogleCloudMlV1Scheduling < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2516 | unittest.expect( |
| 2517 | o.maxRunningTime!, |
| 2518 | unittest.equals('foo'), |
| 2519 | ); |
| 2520 | unittest.expect( |
| 2521 | o.maxWaitTime!, |
| 2522 | unittest.equals('foo'), |
| 2523 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2524 | } |
| 2525 | buildCounterGoogleCloudMlV1Scheduling--; |
| 2526 | } |
| 2527 | |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2528 | core.int buildCounterGoogleCloudMlV1SetDefaultVersionRequest = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2529 | api.GoogleCloudMlV1SetDefaultVersionRequest |
| 2530 | buildGoogleCloudMlV1SetDefaultVersionRequest() { |
| 2531 | var o = api.GoogleCloudMlV1SetDefaultVersionRequest(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2532 | buildCounterGoogleCloudMlV1SetDefaultVersionRequest++; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 2533 | if (buildCounterGoogleCloudMlV1SetDefaultVersionRequest < 3) {} |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2534 | buildCounterGoogleCloudMlV1SetDefaultVersionRequest--; |
| 2535 | return o; |
| 2536 | } |
| 2537 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2538 | void checkGoogleCloudMlV1SetDefaultVersionRequest( |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 2539 | api.GoogleCloudMlV1SetDefaultVersionRequest o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2540 | buildCounterGoogleCloudMlV1SetDefaultVersionRequest++; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 2541 | if (buildCounterGoogleCloudMlV1SetDefaultVersionRequest < 3) {} |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2542 | buildCounterGoogleCloudMlV1SetDefaultVersionRequest--; |
| 2543 | } |
| 2544 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2545 | core.int buildCounterGoogleCloudMlV1StopTrialRequest = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2546 | api.GoogleCloudMlV1StopTrialRequest buildGoogleCloudMlV1StopTrialRequest() { |
| 2547 | var o = api.GoogleCloudMlV1StopTrialRequest(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2548 | buildCounterGoogleCloudMlV1StopTrialRequest++; |
| 2549 | if (buildCounterGoogleCloudMlV1StopTrialRequest < 3) {} |
| 2550 | buildCounterGoogleCloudMlV1StopTrialRequest--; |
| 2551 | return o; |
| 2552 | } |
| 2553 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2554 | void checkGoogleCloudMlV1StopTrialRequest( |
| 2555 | api.GoogleCloudMlV1StopTrialRequest o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2556 | buildCounterGoogleCloudMlV1StopTrialRequest++; |
| 2557 | if (buildCounterGoogleCloudMlV1StopTrialRequest < 3) {} |
| 2558 | buildCounterGoogleCloudMlV1StopTrialRequest--; |
| 2559 | } |
| 2560 | |
| 2561 | core.int buildCounterGoogleCloudMlV1Study = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2562 | api.GoogleCloudMlV1Study buildGoogleCloudMlV1Study() { |
| 2563 | var o = api.GoogleCloudMlV1Study(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2564 | buildCounterGoogleCloudMlV1Study++; |
| 2565 | if (buildCounterGoogleCloudMlV1Study < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2566 | o.createTime = 'foo'; |
| 2567 | o.inactiveReason = 'foo'; |
| 2568 | o.name = 'foo'; |
| 2569 | o.state = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2570 | o.studyConfig = buildGoogleCloudMlV1StudyConfig(); |
| 2571 | } |
| 2572 | buildCounterGoogleCloudMlV1Study--; |
| 2573 | return o; |
| 2574 | } |
| 2575 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2576 | void checkGoogleCloudMlV1Study(api.GoogleCloudMlV1Study o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2577 | buildCounterGoogleCloudMlV1Study++; |
| 2578 | if (buildCounterGoogleCloudMlV1Study < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2579 | unittest.expect( |
| 2580 | o.createTime!, |
| 2581 | unittest.equals('foo'), |
| 2582 | ); |
| 2583 | unittest.expect( |
| 2584 | o.inactiveReason!, |
| 2585 | unittest.equals('foo'), |
| 2586 | ); |
| 2587 | unittest.expect( |
| 2588 | o.name!, |
| 2589 | unittest.equals('foo'), |
| 2590 | ); |
| 2591 | unittest.expect( |
| 2592 | o.state!, |
| 2593 | unittest.equals('foo'), |
| 2594 | ); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 2595 | checkGoogleCloudMlV1StudyConfig( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2596 | o.studyConfig! as api.GoogleCloudMlV1StudyConfig); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2597 | } |
| 2598 | buildCounterGoogleCloudMlV1Study--; |
| 2599 | } |
| 2600 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2601 | core.List<api.GoogleCloudMlV1StudyConfigMetricSpec> buildUnnamed7430() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2602 | var o = <api.GoogleCloudMlV1StudyConfigMetricSpec>[]; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2603 | o.add(buildGoogleCloudMlV1StudyConfigMetricSpec()); |
| 2604 | o.add(buildGoogleCloudMlV1StudyConfigMetricSpec()); |
| 2605 | return o; |
| 2606 | } |
| 2607 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2608 | void checkUnnamed7430(core.List<api.GoogleCloudMlV1StudyConfigMetricSpec> o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2609 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 2610 | checkGoogleCloudMlV1StudyConfigMetricSpec( |
| 2611 | o[0] as api.GoogleCloudMlV1StudyConfigMetricSpec); |
| 2612 | checkGoogleCloudMlV1StudyConfigMetricSpec( |
| 2613 | o[1] as api.GoogleCloudMlV1StudyConfigMetricSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2614 | } |
| 2615 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2616 | core.List<api.GoogleCloudMlV1StudyConfigParameterSpec> buildUnnamed7431() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2617 | var o = <api.GoogleCloudMlV1StudyConfigParameterSpec>[]; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2618 | o.add(buildGoogleCloudMlV1StudyConfigParameterSpec()); |
| 2619 | o.add(buildGoogleCloudMlV1StudyConfigParameterSpec()); |
| 2620 | return o; |
| 2621 | } |
| 2622 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2623 | void checkUnnamed7431( |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2624 | core.List<api.GoogleCloudMlV1StudyConfigParameterSpec> o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2625 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 2626 | checkGoogleCloudMlV1StudyConfigParameterSpec( |
| 2627 | o[0] as api.GoogleCloudMlV1StudyConfigParameterSpec); |
| 2628 | checkGoogleCloudMlV1StudyConfigParameterSpec( |
| 2629 | o[1] as api.GoogleCloudMlV1StudyConfigParameterSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2630 | } |
| 2631 | |
| 2632 | core.int buildCounterGoogleCloudMlV1StudyConfig = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2633 | api.GoogleCloudMlV1StudyConfig buildGoogleCloudMlV1StudyConfig() { |
| 2634 | var o = api.GoogleCloudMlV1StudyConfig(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2635 | buildCounterGoogleCloudMlV1StudyConfig++; |
| 2636 | if (buildCounterGoogleCloudMlV1StudyConfig < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2637 | o.algorithm = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2638 | o.automatedStoppingConfig = buildGoogleCloudMlV1AutomatedStoppingConfig(); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2639 | o.metrics = buildUnnamed7430(); |
| 2640 | o.parameters = buildUnnamed7431(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2641 | } |
| 2642 | buildCounterGoogleCloudMlV1StudyConfig--; |
| 2643 | return o; |
| 2644 | } |
| 2645 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2646 | void checkGoogleCloudMlV1StudyConfig(api.GoogleCloudMlV1StudyConfig o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2647 | buildCounterGoogleCloudMlV1StudyConfig++; |
| 2648 | if (buildCounterGoogleCloudMlV1StudyConfig < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2649 | unittest.expect( |
| 2650 | o.algorithm!, |
| 2651 | unittest.equals('foo'), |
| 2652 | ); |
| 2653 | checkGoogleCloudMlV1AutomatedStoppingConfig(o.automatedStoppingConfig! |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 2654 | as api.GoogleCloudMlV1AutomatedStoppingConfig); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2655 | checkUnnamed7430(o.metrics!); |
| 2656 | checkUnnamed7431(o.parameters!); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2657 | } |
| 2658 | buildCounterGoogleCloudMlV1StudyConfig--; |
| 2659 | } |
| 2660 | |
| 2661 | core.int buildCounterGoogleCloudMlV1SuggestTrialsMetadata = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2662 | api.GoogleCloudMlV1SuggestTrialsMetadata |
| 2663 | buildGoogleCloudMlV1SuggestTrialsMetadata() { |
| 2664 | var o = api.GoogleCloudMlV1SuggestTrialsMetadata(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2665 | buildCounterGoogleCloudMlV1SuggestTrialsMetadata++; |
| 2666 | if (buildCounterGoogleCloudMlV1SuggestTrialsMetadata < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2667 | o.clientId = 'foo'; |
| 2668 | o.createTime = 'foo'; |
| 2669 | o.study = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2670 | o.suggestionCount = 42; |
| 2671 | } |
| 2672 | buildCounterGoogleCloudMlV1SuggestTrialsMetadata--; |
| 2673 | return o; |
| 2674 | } |
| 2675 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2676 | void checkGoogleCloudMlV1SuggestTrialsMetadata( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2677 | api.GoogleCloudMlV1SuggestTrialsMetadata o) { |
| 2678 | buildCounterGoogleCloudMlV1SuggestTrialsMetadata++; |
| 2679 | if (buildCounterGoogleCloudMlV1SuggestTrialsMetadata < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2680 | unittest.expect( |
| 2681 | o.clientId!, |
| 2682 | unittest.equals('foo'), |
| 2683 | ); |
| 2684 | unittest.expect( |
| 2685 | o.createTime!, |
| 2686 | unittest.equals('foo'), |
| 2687 | ); |
| 2688 | unittest.expect( |
| 2689 | o.study!, |
| 2690 | unittest.equals('foo'), |
| 2691 | ); |
| 2692 | unittest.expect( |
| 2693 | o.suggestionCount!, |
| 2694 | unittest.equals(42), |
| 2695 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2696 | } |
| 2697 | buildCounterGoogleCloudMlV1SuggestTrialsMetadata--; |
| 2698 | } |
| 2699 | |
| 2700 | core.int buildCounterGoogleCloudMlV1SuggestTrialsRequest = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2701 | api.GoogleCloudMlV1SuggestTrialsRequest |
| 2702 | buildGoogleCloudMlV1SuggestTrialsRequest() { |
| 2703 | var o = api.GoogleCloudMlV1SuggestTrialsRequest(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2704 | buildCounterGoogleCloudMlV1SuggestTrialsRequest++; |
| 2705 | if (buildCounterGoogleCloudMlV1SuggestTrialsRequest < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2706 | o.clientId = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2707 | o.suggestionCount = 42; |
| 2708 | } |
| 2709 | buildCounterGoogleCloudMlV1SuggestTrialsRequest--; |
| 2710 | return o; |
| 2711 | } |
| 2712 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2713 | void checkGoogleCloudMlV1SuggestTrialsRequest( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2714 | api.GoogleCloudMlV1SuggestTrialsRequest o) { |
| 2715 | buildCounterGoogleCloudMlV1SuggestTrialsRequest++; |
| 2716 | if (buildCounterGoogleCloudMlV1SuggestTrialsRequest < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2717 | unittest.expect( |
| 2718 | o.clientId!, |
| 2719 | unittest.equals('foo'), |
| 2720 | ); |
| 2721 | unittest.expect( |
| 2722 | o.suggestionCount!, |
| 2723 | unittest.equals(42), |
| 2724 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2725 | } |
| 2726 | buildCounterGoogleCloudMlV1SuggestTrialsRequest--; |
| 2727 | } |
| 2728 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2729 | core.List<api.GoogleCloudMlV1Trial> buildUnnamed7432() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2730 | var o = <api.GoogleCloudMlV1Trial>[]; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2731 | o.add(buildGoogleCloudMlV1Trial()); |
| 2732 | o.add(buildGoogleCloudMlV1Trial()); |
| 2733 | return o; |
| 2734 | } |
| 2735 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2736 | void checkUnnamed7432(core.List<api.GoogleCloudMlV1Trial> o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2737 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 2738 | checkGoogleCloudMlV1Trial(o[0] as api.GoogleCloudMlV1Trial); |
| 2739 | checkGoogleCloudMlV1Trial(o[1] as api.GoogleCloudMlV1Trial); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2740 | } |
| 2741 | |
| 2742 | core.int buildCounterGoogleCloudMlV1SuggestTrialsResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2743 | api.GoogleCloudMlV1SuggestTrialsResponse |
| 2744 | buildGoogleCloudMlV1SuggestTrialsResponse() { |
| 2745 | var o = api.GoogleCloudMlV1SuggestTrialsResponse(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2746 | buildCounterGoogleCloudMlV1SuggestTrialsResponse++; |
| 2747 | if (buildCounterGoogleCloudMlV1SuggestTrialsResponse < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2748 | o.endTime = 'foo'; |
| 2749 | o.startTime = 'foo'; |
| 2750 | o.studyState = 'foo'; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2751 | o.trials = buildUnnamed7432(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2752 | } |
| 2753 | buildCounterGoogleCloudMlV1SuggestTrialsResponse--; |
| 2754 | return o; |
| 2755 | } |
| 2756 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2757 | void checkGoogleCloudMlV1SuggestTrialsResponse( |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2758 | api.GoogleCloudMlV1SuggestTrialsResponse o) { |
| 2759 | buildCounterGoogleCloudMlV1SuggestTrialsResponse++; |
| 2760 | if (buildCounterGoogleCloudMlV1SuggestTrialsResponse < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2761 | unittest.expect( |
| 2762 | o.endTime!, |
| 2763 | unittest.equals('foo'), |
| 2764 | ); |
| 2765 | unittest.expect( |
| 2766 | o.startTime!, |
| 2767 | unittest.equals('foo'), |
| 2768 | ); |
| 2769 | unittest.expect( |
| 2770 | o.studyState!, |
| 2771 | unittest.equals('foo'), |
| 2772 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2773 | checkUnnamed7432(o.trials!); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2774 | } |
| 2775 | buildCounterGoogleCloudMlV1SuggestTrialsResponse--; |
| 2776 | } |
| 2777 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2778 | core.List<core.String> buildUnnamed7433() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2779 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2780 | o.add('foo'); |
| 2781 | o.add('foo'); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2782 | return o; |
| 2783 | } |
| 2784 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2785 | void checkUnnamed7433(core.List<core.String> o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2786 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2787 | unittest.expect( |
| 2788 | o[0], |
| 2789 | unittest.equals('foo'), |
| 2790 | ); |
| 2791 | unittest.expect( |
| 2792 | o[1], |
| 2793 | unittest.equals('foo'), |
| 2794 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2795 | } |
| 2796 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2797 | core.List<core.String> buildUnnamed7434() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2798 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2799 | o.add('foo'); |
| 2800 | o.add('foo'); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2801 | return o; |
| 2802 | } |
| 2803 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2804 | void checkUnnamed7434(core.List<core.String> o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2805 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2806 | unittest.expect( |
| 2807 | o[0], |
| 2808 | unittest.equals('foo'), |
| 2809 | ); |
| 2810 | unittest.expect( |
| 2811 | o[1], |
| 2812 | unittest.equals('foo'), |
| 2813 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2814 | } |
| 2815 | |
| 2816 | core.int buildCounterGoogleCloudMlV1TrainingInput = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2817 | api.GoogleCloudMlV1TrainingInput buildGoogleCloudMlV1TrainingInput() { |
| 2818 | var o = api.GoogleCloudMlV1TrainingInput(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2819 | buildCounterGoogleCloudMlV1TrainingInput++; |
| 2820 | if (buildCounterGoogleCloudMlV1TrainingInput < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2821 | o.args = buildUnnamed7433(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2822 | o.encryptionConfig = buildGoogleCloudMlV1EncryptionConfig(); |
| 2823 | o.evaluatorConfig = buildGoogleCloudMlV1ReplicaConfig(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2824 | o.evaluatorCount = 'foo'; |
| 2825 | o.evaluatorType = 'foo'; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2826 | o.hyperparameters = buildGoogleCloudMlV1HyperparameterSpec(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2827 | o.jobDir = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 2828 | o.masterConfig = buildGoogleCloudMlV1ReplicaConfig(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2829 | o.masterType = 'foo'; |
| 2830 | o.network = 'foo'; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2831 | o.packageUris = buildUnnamed7434(); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 2832 | o.parameterServerConfig = buildGoogleCloudMlV1ReplicaConfig(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2833 | o.parameterServerCount = 'foo'; |
| 2834 | o.parameterServerType = 'foo'; |
| 2835 | o.pythonModule = 'foo'; |
| 2836 | o.pythonVersion = 'foo'; |
| 2837 | o.region = 'foo'; |
| 2838 | o.runtimeVersion = 'foo'; |
| 2839 | o.scaleTier = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2840 | o.scheduling = buildGoogleCloudMlV1Scheduling(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2841 | o.serviceAccount = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2842 | o.useChiefInTfConfig = true; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 2843 | o.workerConfig = buildGoogleCloudMlV1ReplicaConfig(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2844 | o.workerCount = 'foo'; |
| 2845 | o.workerType = 'foo'; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2846 | } |
| 2847 | buildCounterGoogleCloudMlV1TrainingInput--; |
| 2848 | return o; |
| 2849 | } |
| 2850 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2851 | void checkGoogleCloudMlV1TrainingInput(api.GoogleCloudMlV1TrainingInput o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2852 | buildCounterGoogleCloudMlV1TrainingInput++; |
| 2853 | if (buildCounterGoogleCloudMlV1TrainingInput < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2854 | checkUnnamed7433(o.args!); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 2855 | checkGoogleCloudMlV1EncryptionConfig( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2856 | o.encryptionConfig! as api.GoogleCloudMlV1EncryptionConfig); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 2857 | checkGoogleCloudMlV1ReplicaConfig( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2858 | o.evaluatorConfig! as api.GoogleCloudMlV1ReplicaConfig); |
| 2859 | unittest.expect( |
| 2860 | o.evaluatorCount!, |
| 2861 | unittest.equals('foo'), |
| 2862 | ); |
| 2863 | unittest.expect( |
| 2864 | o.evaluatorType!, |
| 2865 | unittest.equals('foo'), |
| 2866 | ); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 2867 | checkGoogleCloudMlV1HyperparameterSpec( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2868 | o.hyperparameters! as api.GoogleCloudMlV1HyperparameterSpec); |
| 2869 | unittest.expect( |
| 2870 | o.jobDir!, |
| 2871 | unittest.equals('foo'), |
| 2872 | ); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 2873 | checkGoogleCloudMlV1ReplicaConfig( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2874 | o.masterConfig! as api.GoogleCloudMlV1ReplicaConfig); |
| 2875 | unittest.expect( |
| 2876 | o.masterType!, |
| 2877 | unittest.equals('foo'), |
| 2878 | ); |
| 2879 | unittest.expect( |
| 2880 | o.network!, |
| 2881 | unittest.equals('foo'), |
| 2882 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2883 | checkUnnamed7434(o.packageUris!); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 2884 | checkGoogleCloudMlV1ReplicaConfig( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2885 | o.parameterServerConfig! as api.GoogleCloudMlV1ReplicaConfig); |
| 2886 | unittest.expect( |
| 2887 | o.parameterServerCount!, |
| 2888 | unittest.equals('foo'), |
| 2889 | ); |
| 2890 | unittest.expect( |
| 2891 | o.parameterServerType!, |
| 2892 | unittest.equals('foo'), |
| 2893 | ); |
| 2894 | unittest.expect( |
| 2895 | o.pythonModule!, |
| 2896 | unittest.equals('foo'), |
| 2897 | ); |
| 2898 | unittest.expect( |
| 2899 | o.pythonVersion!, |
| 2900 | unittest.equals('foo'), |
| 2901 | ); |
| 2902 | unittest.expect( |
| 2903 | o.region!, |
| 2904 | unittest.equals('foo'), |
| 2905 | ); |
| 2906 | unittest.expect( |
| 2907 | o.runtimeVersion!, |
| 2908 | unittest.equals('foo'), |
| 2909 | ); |
| 2910 | unittest.expect( |
| 2911 | o.scaleTier!, |
| 2912 | unittest.equals('foo'), |
| 2913 | ); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 2914 | checkGoogleCloudMlV1Scheduling( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2915 | o.scheduling! as api.GoogleCloudMlV1Scheduling); |
| 2916 | unittest.expect( |
| 2917 | o.serviceAccount!, |
| 2918 | unittest.equals('foo'), |
| 2919 | ); |
| 2920 | unittest.expect(o.useChiefInTfConfig!, unittest.isTrue); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 2921 | checkGoogleCloudMlV1ReplicaConfig( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2922 | o.workerConfig! as api.GoogleCloudMlV1ReplicaConfig); |
| 2923 | unittest.expect( |
| 2924 | o.workerCount!, |
| 2925 | unittest.equals('foo'), |
| 2926 | ); |
| 2927 | unittest.expect( |
| 2928 | o.workerType!, |
| 2929 | unittest.equals('foo'), |
| 2930 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2931 | } |
| 2932 | buildCounterGoogleCloudMlV1TrainingInput--; |
| 2933 | } |
| 2934 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2935 | core.List<api.GoogleCloudMlV1HyperparameterOutput> buildUnnamed7435() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2936 | var o = <api.GoogleCloudMlV1HyperparameterOutput>[]; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2937 | o.add(buildGoogleCloudMlV1HyperparameterOutput()); |
| 2938 | o.add(buildGoogleCloudMlV1HyperparameterOutput()); |
| 2939 | return o; |
| 2940 | } |
| 2941 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2942 | void checkUnnamed7435(core.List<api.GoogleCloudMlV1HyperparameterOutput> o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2943 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 2944 | checkGoogleCloudMlV1HyperparameterOutput( |
| 2945 | o[0] as api.GoogleCloudMlV1HyperparameterOutput); |
| 2946 | checkGoogleCloudMlV1HyperparameterOutput( |
| 2947 | o[1] as api.GoogleCloudMlV1HyperparameterOutput); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2948 | } |
| 2949 | |
| 2950 | core.int buildCounterGoogleCloudMlV1TrainingOutput = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2951 | api.GoogleCloudMlV1TrainingOutput buildGoogleCloudMlV1TrainingOutput() { |
| 2952 | var o = api.GoogleCloudMlV1TrainingOutput(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2953 | buildCounterGoogleCloudMlV1TrainingOutput++; |
| 2954 | if (buildCounterGoogleCloudMlV1TrainingOutput < 3) { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 2955 | o.builtInAlgorithmOutput = buildGoogleCloudMlV1BuiltInAlgorithmOutput(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2956 | o.completedTrialCount = 'foo'; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2957 | o.consumedMLUnits = 42.0; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2958 | o.hyperparameterMetricTag = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 2959 | o.isBuiltInAlgorithmJob = true; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2960 | o.isHyperparameterTuningJob = true; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2961 | o.trials = buildUnnamed7435(); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2962 | } |
| 2963 | buildCounterGoogleCloudMlV1TrainingOutput--; |
| 2964 | return o; |
| 2965 | } |
| 2966 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2967 | void checkGoogleCloudMlV1TrainingOutput(api.GoogleCloudMlV1TrainingOutput o) { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2968 | buildCounterGoogleCloudMlV1TrainingOutput++; |
| 2969 | if (buildCounterGoogleCloudMlV1TrainingOutput < 3) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 2970 | checkGoogleCloudMlV1BuiltInAlgorithmOutput( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 2971 | o.builtInAlgorithmOutput! as api.GoogleCloudMlV1BuiltInAlgorithmOutput); |
| 2972 | unittest.expect( |
| 2973 | o.completedTrialCount!, |
| 2974 | unittest.equals('foo'), |
| 2975 | ); |
| 2976 | unittest.expect( |
| 2977 | o.consumedMLUnits!, |
| 2978 | unittest.equals(42.0), |
| 2979 | ); |
| 2980 | unittest.expect( |
| 2981 | o.hyperparameterMetricTag!, |
| 2982 | unittest.equals('foo'), |
| 2983 | ); |
| 2984 | unittest.expect(o.isBuiltInAlgorithmJob!, unittest.isTrue); |
| 2985 | unittest.expect(o.isHyperparameterTuningJob!, unittest.isTrue); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2986 | checkUnnamed7435(o.trials!); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 2987 | } |
| 2988 | buildCounterGoogleCloudMlV1TrainingOutput--; |
| 2989 | } |
| 2990 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2991 | core.List<api.GoogleCloudMlV1Measurement> buildUnnamed7436() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2992 | var o = <api.GoogleCloudMlV1Measurement>[]; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2993 | o.add(buildGoogleCloudMlV1Measurement()); |
| 2994 | o.add(buildGoogleCloudMlV1Measurement()); |
| 2995 | return o; |
| 2996 | } |
| 2997 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 2998 | void checkUnnamed7436(core.List<api.GoogleCloudMlV1Measurement> o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 2999 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3000 | checkGoogleCloudMlV1Measurement(o[0] as api.GoogleCloudMlV1Measurement); |
| 3001 | checkGoogleCloudMlV1Measurement(o[1] as api.GoogleCloudMlV1Measurement); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3002 | } |
| 3003 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3004 | core.List<api.GoogleCloudMlV1TrialParameter> buildUnnamed7437() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3005 | var o = <api.GoogleCloudMlV1TrialParameter>[]; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3006 | o.add(buildGoogleCloudMlV1TrialParameter()); |
| 3007 | o.add(buildGoogleCloudMlV1TrialParameter()); |
| 3008 | return o; |
| 3009 | } |
| 3010 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3011 | void checkUnnamed7437(core.List<api.GoogleCloudMlV1TrialParameter> o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3012 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3013 | checkGoogleCloudMlV1TrialParameter(o[0] as api.GoogleCloudMlV1TrialParameter); |
| 3014 | checkGoogleCloudMlV1TrialParameter(o[1] as api.GoogleCloudMlV1TrialParameter); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3015 | } |
| 3016 | |
| 3017 | core.int buildCounterGoogleCloudMlV1Trial = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3018 | api.GoogleCloudMlV1Trial buildGoogleCloudMlV1Trial() { |
| 3019 | var o = api.GoogleCloudMlV1Trial(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3020 | buildCounterGoogleCloudMlV1Trial++; |
| 3021 | if (buildCounterGoogleCloudMlV1Trial < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3022 | o.clientId = 'foo'; |
| 3023 | o.endTime = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3024 | o.finalMeasurement = buildGoogleCloudMlV1Measurement(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3025 | o.infeasibleReason = 'foo'; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3026 | o.measurements = buildUnnamed7436(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3027 | o.name = 'foo'; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3028 | o.parameters = buildUnnamed7437(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3029 | o.startTime = 'foo'; |
| 3030 | o.state = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3031 | o.trialInfeasible = true; |
| 3032 | } |
| 3033 | buildCounterGoogleCloudMlV1Trial--; |
| 3034 | return o; |
| 3035 | } |
| 3036 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3037 | void checkGoogleCloudMlV1Trial(api.GoogleCloudMlV1Trial o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3038 | buildCounterGoogleCloudMlV1Trial++; |
| 3039 | if (buildCounterGoogleCloudMlV1Trial < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3040 | unittest.expect( |
| 3041 | o.clientId!, |
| 3042 | unittest.equals('foo'), |
| 3043 | ); |
| 3044 | unittest.expect( |
| 3045 | o.endTime!, |
| 3046 | unittest.equals('foo'), |
| 3047 | ); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3048 | checkGoogleCloudMlV1Measurement( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3049 | o.finalMeasurement! as api.GoogleCloudMlV1Measurement); |
| 3050 | unittest.expect( |
| 3051 | o.infeasibleReason!, |
| 3052 | unittest.equals('foo'), |
| 3053 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3054 | checkUnnamed7436(o.measurements!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3055 | unittest.expect( |
| 3056 | o.name!, |
| 3057 | unittest.equals('foo'), |
| 3058 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3059 | checkUnnamed7437(o.parameters!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3060 | unittest.expect( |
| 3061 | o.startTime!, |
| 3062 | unittest.equals('foo'), |
| 3063 | ); |
| 3064 | unittest.expect( |
| 3065 | o.state!, |
| 3066 | unittest.equals('foo'), |
| 3067 | ); |
| 3068 | unittest.expect(o.trialInfeasible!, unittest.isTrue); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3069 | } |
| 3070 | buildCounterGoogleCloudMlV1Trial--; |
| 3071 | } |
| 3072 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3073 | core.Map<core.String, core.String> buildUnnamed7438() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3074 | var o = <core.String, core.String>{}; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3075 | o['x'] = 'foo'; |
| 3076 | o['y'] = 'foo'; |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 3077 | return o; |
| 3078 | } |
| 3079 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3080 | void checkUnnamed7438(core.Map<core.String, core.String> o) { |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 3081 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3082 | unittest.expect( |
| 3083 | o['x']!, |
| 3084 | unittest.equals('foo'), |
| 3085 | ); |
| 3086 | unittest.expect( |
| 3087 | o['y']!, |
| 3088 | unittest.equals('foo'), |
| 3089 | ); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 3090 | } |
| 3091 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3092 | core.List<core.String> buildUnnamed7439() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3093 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3094 | o.add('foo'); |
| 3095 | o.add('foo'); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 3096 | return o; |
| 3097 | } |
| 3098 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3099 | void checkUnnamed7439(core.List<core.String> o) { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 3100 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3101 | unittest.expect( |
| 3102 | o[0], |
| 3103 | unittest.equals('foo'), |
| 3104 | ); |
| 3105 | unittest.expect( |
| 3106 | o[1], |
| 3107 | unittest.equals('foo'), |
| 3108 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 3109 | } |
| 3110 | |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 3111 | core.int buildCounterGoogleCloudMlV1Version = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3112 | api.GoogleCloudMlV1Version buildGoogleCloudMlV1Version() { |
| 3113 | var o = api.GoogleCloudMlV1Version(); |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 3114 | buildCounterGoogleCloudMlV1Version++; |
| 3115 | if (buildCounterGoogleCloudMlV1Version < 3) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3116 | o.acceleratorConfig = buildGoogleCloudMlV1AcceleratorConfig(); |
Martin Kustermann | fa83e31 | 2017-07-31 12:48:45 +0200 | [diff] [blame] | 3117 | o.autoScaling = buildGoogleCloudMlV1AutoScaling(); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 3118 | o.container = buildGoogleCloudMlV1ContainerSpec(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3119 | o.createTime = 'foo'; |
| 3120 | o.deploymentUri = 'foo'; |
| 3121 | o.description = 'foo'; |
| 3122 | o.errorMessage = 'foo'; |
| 3123 | o.etag = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3124 | o.explanationConfig = buildGoogleCloudMlV1ExplanationConfig(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3125 | o.framework = 'foo'; |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 3126 | o.isDefault = true; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3127 | o.labels = buildUnnamed7438(); |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 3128 | o.lastMigrationModelId = 'foo'; |
| 3129 | o.lastMigrationTime = 'foo'; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3130 | o.lastUseTime = 'foo'; |
| 3131 | o.machineType = 'foo'; |
Martin Kustermann | 77f42ff | 2017-03-06 13:56:35 +0100 | [diff] [blame] | 3132 | o.manualScaling = buildGoogleCloudMlV1ManualScaling(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3133 | o.name = 'foo'; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3134 | o.packageUris = buildUnnamed7439(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3135 | o.predictionClass = 'foo'; |
| 3136 | o.pythonVersion = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3137 | o.requestLoggingConfig = buildGoogleCloudMlV1RequestLoggingConfig(); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 3138 | o.routes = buildGoogleCloudMlV1RouteMap(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3139 | o.runtimeVersion = 'foo'; |
| 3140 | o.serviceAccount = 'foo'; |
| 3141 | o.state = 'foo'; |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 3142 | } |
| 3143 | buildCounterGoogleCloudMlV1Version--; |
| 3144 | return o; |
| 3145 | } |
| 3146 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3147 | void checkGoogleCloudMlV1Version(api.GoogleCloudMlV1Version o) { |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 3148 | buildCounterGoogleCloudMlV1Version++; |
| 3149 | if (buildCounterGoogleCloudMlV1Version < 3) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3150 | checkGoogleCloudMlV1AcceleratorConfig( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3151 | o.acceleratorConfig! as api.GoogleCloudMlV1AcceleratorConfig); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3152 | checkGoogleCloudMlV1AutoScaling( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3153 | o.autoScaling! as api.GoogleCloudMlV1AutoScaling); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3154 | checkGoogleCloudMlV1ContainerSpec( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3155 | o.container! as api.GoogleCloudMlV1ContainerSpec); |
| 3156 | unittest.expect( |
| 3157 | o.createTime!, |
| 3158 | unittest.equals('foo'), |
| 3159 | ); |
| 3160 | unittest.expect( |
| 3161 | o.deploymentUri!, |
| 3162 | unittest.equals('foo'), |
| 3163 | ); |
| 3164 | unittest.expect( |
| 3165 | o.description!, |
| 3166 | unittest.equals('foo'), |
| 3167 | ); |
| 3168 | unittest.expect( |
| 3169 | o.errorMessage!, |
| 3170 | unittest.equals('foo'), |
| 3171 | ); |
| 3172 | unittest.expect( |
| 3173 | o.etag!, |
| 3174 | unittest.equals('foo'), |
| 3175 | ); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3176 | checkGoogleCloudMlV1ExplanationConfig( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3177 | o.explanationConfig! as api.GoogleCloudMlV1ExplanationConfig); |
| 3178 | unittest.expect( |
| 3179 | o.framework!, |
| 3180 | unittest.equals('foo'), |
| 3181 | ); |
| 3182 | unittest.expect(o.isDefault!, unittest.isTrue); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3183 | checkUnnamed7438(o.labels!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3184 | unittest.expect( |
| 3185 | o.lastMigrationModelId!, |
| 3186 | unittest.equals('foo'), |
| 3187 | ); |
| 3188 | unittest.expect( |
| 3189 | o.lastMigrationTime!, |
| 3190 | unittest.equals('foo'), |
| 3191 | ); |
| 3192 | unittest.expect( |
| 3193 | o.lastUseTime!, |
| 3194 | unittest.equals('foo'), |
| 3195 | ); |
| 3196 | unittest.expect( |
| 3197 | o.machineType!, |
| 3198 | unittest.equals('foo'), |
| 3199 | ); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3200 | checkGoogleCloudMlV1ManualScaling( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3201 | o.manualScaling! as api.GoogleCloudMlV1ManualScaling); |
| 3202 | unittest.expect( |
| 3203 | o.name!, |
| 3204 | unittest.equals('foo'), |
| 3205 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3206 | checkUnnamed7439(o.packageUris!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3207 | unittest.expect( |
| 3208 | o.predictionClass!, |
| 3209 | unittest.equals('foo'), |
| 3210 | ); |
| 3211 | unittest.expect( |
| 3212 | o.pythonVersion!, |
| 3213 | unittest.equals('foo'), |
| 3214 | ); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3215 | checkGoogleCloudMlV1RequestLoggingConfig( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3216 | o.requestLoggingConfig! as api.GoogleCloudMlV1RequestLoggingConfig); |
| 3217 | checkGoogleCloudMlV1RouteMap(o.routes! as api.GoogleCloudMlV1RouteMap); |
| 3218 | unittest.expect( |
| 3219 | o.runtimeVersion!, |
| 3220 | unittest.equals('foo'), |
| 3221 | ); |
| 3222 | unittest.expect( |
| 3223 | o.serviceAccount!, |
| 3224 | unittest.equals('foo'), |
| 3225 | ); |
| 3226 | unittest.expect( |
| 3227 | o.state!, |
| 3228 | unittest.equals('foo'), |
| 3229 | ); |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 3230 | } |
| 3231 | buildCounterGoogleCloudMlV1Version--; |
| 3232 | } |
| 3233 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3234 | core.int buildCounterGoogleCloudMlV1XraiAttribution = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3235 | api.GoogleCloudMlV1XraiAttribution buildGoogleCloudMlV1XraiAttribution() { |
| 3236 | var o = api.GoogleCloudMlV1XraiAttribution(); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3237 | buildCounterGoogleCloudMlV1XraiAttribution++; |
| 3238 | if (buildCounterGoogleCloudMlV1XraiAttribution < 3) { |
| 3239 | o.numIntegralSteps = 42; |
| 3240 | } |
| 3241 | buildCounterGoogleCloudMlV1XraiAttribution--; |
| 3242 | return o; |
| 3243 | } |
| 3244 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3245 | void checkGoogleCloudMlV1XraiAttribution(api.GoogleCloudMlV1XraiAttribution o) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3246 | buildCounterGoogleCloudMlV1XraiAttribution++; |
| 3247 | if (buildCounterGoogleCloudMlV1XraiAttribution < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3248 | unittest.expect( |
| 3249 | o.numIntegralSteps!, |
| 3250 | unittest.equals(42), |
| 3251 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3252 | } |
| 3253 | buildCounterGoogleCloudMlV1XraiAttribution--; |
| 3254 | } |
| 3255 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3256 | core.List<api.GoogleIamV1AuditLogConfig> buildUnnamed7440() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3257 | var o = <api.GoogleIamV1AuditLogConfig>[]; |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3258 | o.add(buildGoogleIamV1AuditLogConfig()); |
| 3259 | o.add(buildGoogleIamV1AuditLogConfig()); |
| 3260 | return o; |
| 3261 | } |
| 3262 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3263 | void checkUnnamed7440(core.List<api.GoogleIamV1AuditLogConfig> o) { |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3264 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3265 | checkGoogleIamV1AuditLogConfig(o[0] as api.GoogleIamV1AuditLogConfig); |
| 3266 | checkGoogleIamV1AuditLogConfig(o[1] as api.GoogleIamV1AuditLogConfig); |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3267 | } |
| 3268 | |
| 3269 | core.int buildCounterGoogleIamV1AuditConfig = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3270 | api.GoogleIamV1AuditConfig buildGoogleIamV1AuditConfig() { |
| 3271 | var o = api.GoogleIamV1AuditConfig(); |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3272 | buildCounterGoogleIamV1AuditConfig++; |
| 3273 | if (buildCounterGoogleIamV1AuditConfig < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3274 | o.auditLogConfigs = buildUnnamed7440(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3275 | o.service = 'foo'; |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3276 | } |
| 3277 | buildCounterGoogleIamV1AuditConfig--; |
| 3278 | return o; |
| 3279 | } |
| 3280 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3281 | void checkGoogleIamV1AuditConfig(api.GoogleIamV1AuditConfig o) { |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3282 | buildCounterGoogleIamV1AuditConfig++; |
| 3283 | if (buildCounterGoogleIamV1AuditConfig < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3284 | checkUnnamed7440(o.auditLogConfigs!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3285 | unittest.expect( |
| 3286 | o.service!, |
| 3287 | unittest.equals('foo'), |
| 3288 | ); |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3289 | } |
| 3290 | buildCounterGoogleIamV1AuditConfig--; |
| 3291 | } |
| 3292 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3293 | core.List<core.String> buildUnnamed7441() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3294 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3295 | o.add('foo'); |
| 3296 | o.add('foo'); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3297 | return o; |
| 3298 | } |
| 3299 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3300 | void checkUnnamed7441(core.List<core.String> o) { |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3301 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3302 | unittest.expect( |
| 3303 | o[0], |
| 3304 | unittest.equals('foo'), |
| 3305 | ); |
| 3306 | unittest.expect( |
| 3307 | o[1], |
| 3308 | unittest.equals('foo'), |
| 3309 | ); |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3310 | } |
| 3311 | |
| 3312 | core.int buildCounterGoogleIamV1AuditLogConfig = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3313 | api.GoogleIamV1AuditLogConfig buildGoogleIamV1AuditLogConfig() { |
| 3314 | var o = api.GoogleIamV1AuditLogConfig(); |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3315 | buildCounterGoogleIamV1AuditLogConfig++; |
| 3316 | if (buildCounterGoogleIamV1AuditLogConfig < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3317 | o.exemptedMembers = buildUnnamed7441(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3318 | o.logType = 'foo'; |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3319 | } |
| 3320 | buildCounterGoogleIamV1AuditLogConfig--; |
| 3321 | return o; |
| 3322 | } |
| 3323 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3324 | void checkGoogleIamV1AuditLogConfig(api.GoogleIamV1AuditLogConfig o) { |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3325 | buildCounterGoogleIamV1AuditLogConfig++; |
| 3326 | if (buildCounterGoogleIamV1AuditLogConfig < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3327 | checkUnnamed7441(o.exemptedMembers!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3328 | unittest.expect( |
| 3329 | o.logType!, |
| 3330 | unittest.equals('foo'), |
| 3331 | ); |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3332 | } |
| 3333 | buildCounterGoogleIamV1AuditLogConfig--; |
| 3334 | } |
| 3335 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3336 | core.List<core.String> buildUnnamed7442() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3337 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3338 | o.add('foo'); |
| 3339 | o.add('foo'); |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3340 | return o; |
| 3341 | } |
| 3342 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3343 | void checkUnnamed7442(core.List<core.String> o) { |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3344 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3345 | unittest.expect( |
| 3346 | o[0], |
| 3347 | unittest.equals('foo'), |
| 3348 | ); |
| 3349 | unittest.expect( |
| 3350 | o[1], |
| 3351 | unittest.equals('foo'), |
| 3352 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3353 | } |
| 3354 | |
| 3355 | core.int buildCounterGoogleIamV1Binding = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3356 | api.GoogleIamV1Binding buildGoogleIamV1Binding() { |
| 3357 | var o = api.GoogleIamV1Binding(); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3358 | buildCounterGoogleIamV1Binding++; |
| 3359 | if (buildCounterGoogleIamV1Binding < 3) { |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 3360 | o.condition = buildGoogleTypeExpr(); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3361 | o.members = buildUnnamed7442(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3362 | o.role = 'foo'; |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3363 | } |
| 3364 | buildCounterGoogleIamV1Binding--; |
| 3365 | return o; |
| 3366 | } |
| 3367 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3368 | void checkGoogleIamV1Binding(api.GoogleIamV1Binding o) { |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3369 | buildCounterGoogleIamV1Binding++; |
| 3370 | if (buildCounterGoogleIamV1Binding < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3371 | checkGoogleTypeExpr(o.condition! as api.GoogleTypeExpr); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3372 | checkUnnamed7442(o.members!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3373 | unittest.expect( |
| 3374 | o.role!, |
| 3375 | unittest.equals('foo'), |
| 3376 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3377 | } |
| 3378 | buildCounterGoogleIamV1Binding--; |
| 3379 | } |
| 3380 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3381 | core.List<api.GoogleIamV1AuditConfig> buildUnnamed7443() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3382 | var o = <api.GoogleIamV1AuditConfig>[]; |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3383 | o.add(buildGoogleIamV1AuditConfig()); |
| 3384 | o.add(buildGoogleIamV1AuditConfig()); |
| 3385 | return o; |
| 3386 | } |
| 3387 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3388 | void checkUnnamed7443(core.List<api.GoogleIamV1AuditConfig> o) { |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3389 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3390 | checkGoogleIamV1AuditConfig(o[0] as api.GoogleIamV1AuditConfig); |
| 3391 | checkGoogleIamV1AuditConfig(o[1] as api.GoogleIamV1AuditConfig); |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 3392 | } |
| 3393 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3394 | core.List<api.GoogleIamV1Binding> buildUnnamed7444() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3395 | var o = <api.GoogleIamV1Binding>[]; |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3396 | o.add(buildGoogleIamV1Binding()); |
| 3397 | o.add(buildGoogleIamV1Binding()); |
| 3398 | return o; |
| 3399 | } |
| 3400 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3401 | void checkUnnamed7444(core.List<api.GoogleIamV1Binding> o) { |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3402 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3403 | checkGoogleIamV1Binding(o[0] as api.GoogleIamV1Binding); |
| 3404 | checkGoogleIamV1Binding(o[1] as api.GoogleIamV1Binding); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3405 | } |
| 3406 | |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3407 | core.int buildCounterGoogleIamV1Policy = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3408 | api.GoogleIamV1Policy buildGoogleIamV1Policy() { |
| 3409 | var o = api.GoogleIamV1Policy(); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3410 | buildCounterGoogleIamV1Policy++; |
| 3411 | if (buildCounterGoogleIamV1Policy < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3412 | o.auditConfigs = buildUnnamed7443(); |
| 3413 | o.bindings = buildUnnamed7444(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3414 | o.etag = 'foo'; |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3415 | o.version = 42; |
| 3416 | } |
| 3417 | buildCounterGoogleIamV1Policy--; |
| 3418 | return o; |
| 3419 | } |
| 3420 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3421 | void checkGoogleIamV1Policy(api.GoogleIamV1Policy o) { |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3422 | buildCounterGoogleIamV1Policy++; |
| 3423 | if (buildCounterGoogleIamV1Policy < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3424 | checkUnnamed7443(o.auditConfigs!); |
| 3425 | checkUnnamed7444(o.bindings!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3426 | unittest.expect( |
| 3427 | o.etag!, |
| 3428 | unittest.equals('foo'), |
| 3429 | ); |
| 3430 | unittest.expect( |
| 3431 | o.version!, |
| 3432 | unittest.equals(42), |
| 3433 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3434 | } |
| 3435 | buildCounterGoogleIamV1Policy--; |
| 3436 | } |
| 3437 | |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3438 | core.int buildCounterGoogleIamV1SetIamPolicyRequest = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3439 | api.GoogleIamV1SetIamPolicyRequest buildGoogleIamV1SetIamPolicyRequest() { |
| 3440 | var o = api.GoogleIamV1SetIamPolicyRequest(); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3441 | buildCounterGoogleIamV1SetIamPolicyRequest++; |
| 3442 | if (buildCounterGoogleIamV1SetIamPolicyRequest < 3) { |
| 3443 | o.policy = buildGoogleIamV1Policy(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3444 | o.updateMask = 'foo'; |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3445 | } |
| 3446 | buildCounterGoogleIamV1SetIamPolicyRequest--; |
| 3447 | return o; |
| 3448 | } |
| 3449 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3450 | void checkGoogleIamV1SetIamPolicyRequest(api.GoogleIamV1SetIamPolicyRequest o) { |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3451 | buildCounterGoogleIamV1SetIamPolicyRequest++; |
| 3452 | if (buildCounterGoogleIamV1SetIamPolicyRequest < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3453 | checkGoogleIamV1Policy(o.policy! as api.GoogleIamV1Policy); |
| 3454 | unittest.expect( |
| 3455 | o.updateMask!, |
| 3456 | unittest.equals('foo'), |
| 3457 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3458 | } |
| 3459 | buildCounterGoogleIamV1SetIamPolicyRequest--; |
| 3460 | } |
| 3461 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3462 | core.List<core.String> buildUnnamed7445() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3463 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3464 | o.add('foo'); |
| 3465 | o.add('foo'); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3466 | return o; |
| 3467 | } |
| 3468 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3469 | void checkUnnamed7445(core.List<core.String> o) { |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3470 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3471 | unittest.expect( |
| 3472 | o[0], |
| 3473 | unittest.equals('foo'), |
| 3474 | ); |
| 3475 | unittest.expect( |
| 3476 | o[1], |
| 3477 | unittest.equals('foo'), |
| 3478 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3479 | } |
| 3480 | |
| 3481 | core.int buildCounterGoogleIamV1TestIamPermissionsRequest = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3482 | api.GoogleIamV1TestIamPermissionsRequest |
| 3483 | buildGoogleIamV1TestIamPermissionsRequest() { |
| 3484 | var o = api.GoogleIamV1TestIamPermissionsRequest(); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3485 | buildCounterGoogleIamV1TestIamPermissionsRequest++; |
| 3486 | if (buildCounterGoogleIamV1TestIamPermissionsRequest < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3487 | o.permissions = buildUnnamed7445(); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3488 | } |
| 3489 | buildCounterGoogleIamV1TestIamPermissionsRequest--; |
| 3490 | return o; |
| 3491 | } |
| 3492 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3493 | void checkGoogleIamV1TestIamPermissionsRequest( |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3494 | api.GoogleIamV1TestIamPermissionsRequest o) { |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3495 | buildCounterGoogleIamV1TestIamPermissionsRequest++; |
| 3496 | if (buildCounterGoogleIamV1TestIamPermissionsRequest < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3497 | checkUnnamed7445(o.permissions!); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3498 | } |
| 3499 | buildCounterGoogleIamV1TestIamPermissionsRequest--; |
| 3500 | } |
| 3501 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3502 | core.List<core.String> buildUnnamed7446() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3503 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3504 | o.add('foo'); |
| 3505 | o.add('foo'); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3506 | return o; |
| 3507 | } |
| 3508 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3509 | void checkUnnamed7446(core.List<core.String> o) { |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3510 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3511 | unittest.expect( |
| 3512 | o[0], |
| 3513 | unittest.equals('foo'), |
| 3514 | ); |
| 3515 | unittest.expect( |
| 3516 | o[1], |
| 3517 | unittest.equals('foo'), |
| 3518 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3519 | } |
| 3520 | |
| 3521 | core.int buildCounterGoogleIamV1TestIamPermissionsResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3522 | api.GoogleIamV1TestIamPermissionsResponse |
| 3523 | buildGoogleIamV1TestIamPermissionsResponse() { |
| 3524 | var o = api.GoogleIamV1TestIamPermissionsResponse(); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3525 | buildCounterGoogleIamV1TestIamPermissionsResponse++; |
| 3526 | if (buildCounterGoogleIamV1TestIamPermissionsResponse < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3527 | o.permissions = buildUnnamed7446(); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3528 | } |
| 3529 | buildCounterGoogleIamV1TestIamPermissionsResponse--; |
| 3530 | return o; |
| 3531 | } |
| 3532 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3533 | void checkGoogleIamV1TestIamPermissionsResponse( |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3534 | api.GoogleIamV1TestIamPermissionsResponse o) { |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3535 | buildCounterGoogleIamV1TestIamPermissionsResponse++; |
| 3536 | if (buildCounterGoogleIamV1TestIamPermissionsResponse < 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3537 | checkUnnamed7446(o.permissions!); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 3538 | } |
| 3539 | buildCounterGoogleIamV1TestIamPermissionsResponse--; |
| 3540 | } |
| 3541 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3542 | core.List<api.GoogleLongrunningOperation> buildUnnamed7447() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3543 | var o = <api.GoogleLongrunningOperation>[]; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3544 | o.add(buildGoogleLongrunningOperation()); |
| 3545 | o.add(buildGoogleLongrunningOperation()); |
| 3546 | return o; |
| 3547 | } |
| 3548 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3549 | void checkUnnamed7447(core.List<api.GoogleLongrunningOperation> o) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3550 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3551 | checkGoogleLongrunningOperation(o[0] as api.GoogleLongrunningOperation); |
| 3552 | checkGoogleLongrunningOperation(o[1] as api.GoogleLongrunningOperation); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3553 | } |
| 3554 | |
| 3555 | core.int buildCounterGoogleLongrunningListOperationsResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3556 | api.GoogleLongrunningListOperationsResponse |
| 3557 | buildGoogleLongrunningListOperationsResponse() { |
| 3558 | var o = api.GoogleLongrunningListOperationsResponse(); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3559 | buildCounterGoogleLongrunningListOperationsResponse++; |
| 3560 | if (buildCounterGoogleLongrunningListOperationsResponse < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3561 | o.nextPageToken = 'foo'; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3562 | o.operations = buildUnnamed7447(); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3563 | } |
| 3564 | buildCounterGoogleLongrunningListOperationsResponse--; |
| 3565 | return o; |
| 3566 | } |
| 3567 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3568 | void checkGoogleLongrunningListOperationsResponse( |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3569 | api.GoogleLongrunningListOperationsResponse o) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3570 | buildCounterGoogleLongrunningListOperationsResponse++; |
| 3571 | if (buildCounterGoogleLongrunningListOperationsResponse < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3572 | unittest.expect( |
| 3573 | o.nextPageToken!, |
| 3574 | unittest.equals('foo'), |
| 3575 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3576 | checkUnnamed7447(o.operations!); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3577 | } |
| 3578 | buildCounterGoogleLongrunningListOperationsResponse--; |
| 3579 | } |
| 3580 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3581 | core.Map<core.String, core.Object> buildUnnamed7448() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3582 | var o = <core.String, core.Object>{}; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3583 | o['x'] = { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3584 | 'list': [1, 2, 3], |
| 3585 | 'bool': true, |
| 3586 | 'string': 'foo' |
| 3587 | }; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3588 | o['y'] = { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3589 | 'list': [1, 2, 3], |
| 3590 | 'bool': true, |
| 3591 | 'string': 'foo' |
| 3592 | }; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3593 | return o; |
| 3594 | } |
| 3595 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3596 | void checkUnnamed7448(core.Map<core.String, core.Object> o) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3597 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3598 | var casted3 = (o['x']!) as core.Map; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3599 | unittest.expect(casted3, unittest.hasLength(3)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3600 | unittest.expect( |
| 3601 | casted3['list'], |
| 3602 | unittest.equals([1, 2, 3]), |
| 3603 | ); |
| 3604 | unittest.expect( |
| 3605 | casted3['bool'], |
| 3606 | unittest.equals(true), |
| 3607 | ); |
| 3608 | unittest.expect( |
| 3609 | casted3['string'], |
| 3610 | unittest.equals('foo'), |
| 3611 | ); |
| 3612 | var casted4 = (o['y']!) as core.Map; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3613 | unittest.expect(casted4, unittest.hasLength(3)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3614 | unittest.expect( |
| 3615 | casted4['list'], |
| 3616 | unittest.equals([1, 2, 3]), |
| 3617 | ); |
| 3618 | unittest.expect( |
| 3619 | casted4['bool'], |
| 3620 | unittest.equals(true), |
| 3621 | ); |
| 3622 | unittest.expect( |
| 3623 | casted4['string'], |
| 3624 | unittest.equals('foo'), |
| 3625 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3626 | } |
| 3627 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3628 | core.Map<core.String, core.Object> buildUnnamed7449() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3629 | var o = <core.String, core.Object>{}; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3630 | o['x'] = { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3631 | 'list': [1, 2, 3], |
| 3632 | 'bool': true, |
| 3633 | 'string': 'foo' |
| 3634 | }; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3635 | o['y'] = { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3636 | 'list': [1, 2, 3], |
| 3637 | 'bool': true, |
| 3638 | 'string': 'foo' |
| 3639 | }; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 3640 | return o; |
| 3641 | } |
| 3642 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3643 | void checkUnnamed7449(core.Map<core.String, core.Object> o) { |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 3644 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3645 | var casted5 = (o['x']!) as core.Map; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3646 | unittest.expect(casted5, unittest.hasLength(3)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3647 | unittest.expect( |
| 3648 | casted5['list'], |
| 3649 | unittest.equals([1, 2, 3]), |
| 3650 | ); |
| 3651 | unittest.expect( |
| 3652 | casted5['bool'], |
| 3653 | unittest.equals(true), |
| 3654 | ); |
| 3655 | unittest.expect( |
| 3656 | casted5['string'], |
| 3657 | unittest.equals('foo'), |
| 3658 | ); |
| 3659 | var casted6 = (o['y']!) as core.Map; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3660 | unittest.expect(casted6, unittest.hasLength(3)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3661 | unittest.expect( |
| 3662 | casted6['list'], |
| 3663 | unittest.equals([1, 2, 3]), |
| 3664 | ); |
| 3665 | unittest.expect( |
| 3666 | casted6['bool'], |
| 3667 | unittest.equals(true), |
| 3668 | ); |
| 3669 | unittest.expect( |
| 3670 | casted6['string'], |
| 3671 | unittest.equals('foo'), |
| 3672 | ); |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 3673 | } |
| 3674 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3675 | core.int buildCounterGoogleLongrunningOperation = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3676 | api.GoogleLongrunningOperation buildGoogleLongrunningOperation() { |
| 3677 | var o = api.GoogleLongrunningOperation(); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3678 | buildCounterGoogleLongrunningOperation++; |
| 3679 | if (buildCounterGoogleLongrunningOperation < 3) { |
| 3680 | o.done = true; |
| 3681 | o.error = buildGoogleRpcStatus(); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3682 | o.metadata = buildUnnamed7448(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3683 | o.name = 'foo'; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3684 | o.response = buildUnnamed7449(); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3685 | } |
| 3686 | buildCounterGoogleLongrunningOperation--; |
| 3687 | return o; |
| 3688 | } |
| 3689 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3690 | void checkGoogleLongrunningOperation(api.GoogleLongrunningOperation o) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3691 | buildCounterGoogleLongrunningOperation++; |
| 3692 | if (buildCounterGoogleLongrunningOperation < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3693 | unittest.expect(o.done!, unittest.isTrue); |
| 3694 | checkGoogleRpcStatus(o.error! as api.GoogleRpcStatus); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3695 | checkUnnamed7448(o.metadata!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3696 | unittest.expect( |
| 3697 | o.name!, |
| 3698 | unittest.equals('foo'), |
| 3699 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3700 | checkUnnamed7449(o.response!); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3701 | } |
| 3702 | buildCounterGoogleLongrunningOperation--; |
| 3703 | } |
| 3704 | |
| 3705 | core.int buildCounterGoogleProtobufEmpty = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3706 | api.GoogleProtobufEmpty buildGoogleProtobufEmpty() { |
| 3707 | var o = api.GoogleProtobufEmpty(); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3708 | buildCounterGoogleProtobufEmpty++; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3709 | if (buildCounterGoogleProtobufEmpty < 3) {} |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3710 | buildCounterGoogleProtobufEmpty--; |
| 3711 | return o; |
| 3712 | } |
| 3713 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3714 | void checkGoogleProtobufEmpty(api.GoogleProtobufEmpty o) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3715 | buildCounterGoogleProtobufEmpty++; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3716 | if (buildCounterGoogleProtobufEmpty < 3) {} |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3717 | buildCounterGoogleProtobufEmpty--; |
| 3718 | } |
| 3719 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3720 | core.Map<core.String, core.Object> buildUnnamed7450() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3721 | var o = <core.String, core.Object>{}; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3722 | o['x'] = { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3723 | 'list': [1, 2, 3], |
| 3724 | 'bool': true, |
| 3725 | 'string': 'foo' |
| 3726 | }; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3727 | o['y'] = { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3728 | 'list': [1, 2, 3], |
| 3729 | 'bool': true, |
| 3730 | 'string': 'foo' |
| 3731 | }; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3732 | return o; |
| 3733 | } |
| 3734 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3735 | void checkUnnamed7450(core.Map<core.String, core.Object> o) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3736 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3737 | var casted7 = (o['x']!) as core.Map; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3738 | unittest.expect(casted7, unittest.hasLength(3)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3739 | unittest.expect( |
| 3740 | casted7['list'], |
| 3741 | unittest.equals([1, 2, 3]), |
| 3742 | ); |
| 3743 | unittest.expect( |
| 3744 | casted7['bool'], |
| 3745 | unittest.equals(true), |
| 3746 | ); |
| 3747 | unittest.expect( |
| 3748 | casted7['string'], |
| 3749 | unittest.equals('foo'), |
| 3750 | ); |
| 3751 | var casted8 = (o['y']!) as core.Map; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3752 | unittest.expect(casted8, unittest.hasLength(3)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3753 | unittest.expect( |
| 3754 | casted8['list'], |
| 3755 | unittest.equals([1, 2, 3]), |
| 3756 | ); |
| 3757 | unittest.expect( |
| 3758 | casted8['bool'], |
| 3759 | unittest.equals(true), |
| 3760 | ); |
| 3761 | unittest.expect( |
| 3762 | casted8['string'], |
| 3763 | unittest.equals('foo'), |
| 3764 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3765 | } |
| 3766 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3767 | core.List<core.Map<core.String, core.Object>> buildUnnamed7451() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3768 | var o = <core.Map<core.String, core.Object>>[]; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3769 | o.add(buildUnnamed7450()); |
| 3770 | o.add(buildUnnamed7450()); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3771 | return o; |
| 3772 | } |
| 3773 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3774 | void checkUnnamed7451(core.List<core.Map<core.String, core.Object>> o) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3775 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3776 | checkUnnamed7450(o[0]); |
| 3777 | checkUnnamed7450(o[1]); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3778 | } |
| 3779 | |
| 3780 | core.int buildCounterGoogleRpcStatus = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3781 | api.GoogleRpcStatus buildGoogleRpcStatus() { |
| 3782 | var o = api.GoogleRpcStatus(); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3783 | buildCounterGoogleRpcStatus++; |
| 3784 | if (buildCounterGoogleRpcStatus < 3) { |
| 3785 | o.code = 42; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3786 | o.details = buildUnnamed7451(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3787 | o.message = 'foo'; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3788 | } |
| 3789 | buildCounterGoogleRpcStatus--; |
| 3790 | return o; |
| 3791 | } |
| 3792 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3793 | void checkGoogleRpcStatus(api.GoogleRpcStatus o) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3794 | buildCounterGoogleRpcStatus++; |
| 3795 | if (buildCounterGoogleRpcStatus < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3796 | unittest.expect( |
| 3797 | o.code!, |
| 3798 | unittest.equals(42), |
| 3799 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 3800 | checkUnnamed7451(o.details!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3801 | unittest.expect( |
| 3802 | o.message!, |
| 3803 | unittest.equals('foo'), |
| 3804 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3805 | } |
| 3806 | buildCounterGoogleRpcStatus--; |
| 3807 | } |
| 3808 | |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 3809 | core.int buildCounterGoogleTypeExpr = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3810 | api.GoogleTypeExpr buildGoogleTypeExpr() { |
| 3811 | var o = api.GoogleTypeExpr(); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 3812 | buildCounterGoogleTypeExpr++; |
| 3813 | if (buildCounterGoogleTypeExpr < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3814 | o.description = 'foo'; |
| 3815 | o.expression = 'foo'; |
| 3816 | o.location = 'foo'; |
| 3817 | o.title = 'foo'; |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 3818 | } |
| 3819 | buildCounterGoogleTypeExpr--; |
| 3820 | return o; |
| 3821 | } |
| 3822 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3823 | void checkGoogleTypeExpr(api.GoogleTypeExpr o) { |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 3824 | buildCounterGoogleTypeExpr++; |
| 3825 | if (buildCounterGoogleTypeExpr < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 3826 | unittest.expect( |
| 3827 | o.description!, |
| 3828 | unittest.equals('foo'), |
| 3829 | ); |
| 3830 | unittest.expect( |
| 3831 | o.expression!, |
| 3832 | unittest.equals('foo'), |
| 3833 | ); |
| 3834 | unittest.expect( |
| 3835 | o.location!, |
| 3836 | unittest.equals('foo'), |
| 3837 | ); |
| 3838 | unittest.expect( |
| 3839 | o.title!, |
| 3840 | unittest.equals('foo'), |
| 3841 | ); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 3842 | } |
| 3843 | buildCounterGoogleTypeExpr--; |
| 3844 | } |
| 3845 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3846 | void main() { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3847 | unittest.group('obj-schema-GoogleApiHttpBody', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 3848 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3849 | var o = buildGoogleApiHttpBody(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3850 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 3851 | var od = api.GoogleApiHttpBody.fromJson( |
| 3852 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3853 | checkGoogleApiHttpBody(od as api.GoogleApiHttpBody); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 3854 | }); |
| 3855 | }); |
| 3856 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 3857 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3858 | 'obj-schema-GoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3859 | () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 3860 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3861 | var o = |
| 3862 | buildGoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3863 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3864 | var od = |
| 3865 | api.GoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3866 | .fromJson(oJson as core.Map<core.String, core.dynamic>); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3867 | checkGoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig( |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3868 | od as api |
| 3869 | .GoogleCloudMlV1AutomatedStoppingConfigDecayCurveAutomatedStoppingConfig); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3870 | }); |
| 3871 | }); |
| 3872 | |
| 3873 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3874 | 'obj-schema-GoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3875 | () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 3876 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3877 | var o = |
| 3878 | buildGoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3879 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3880 | var od = |
| 3881 | api.GoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3882 | .fromJson(oJson as core.Map<core.String, core.dynamic>); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3883 | checkGoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig( |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3884 | od as api |
| 3885 | .GoogleCloudMlV1AutomatedStoppingConfigMedianAutomatedStoppingConfig); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3886 | }); |
| 3887 | }); |
| 3888 | |
| 3889 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3890 | 'obj-schema-GoogleCloudMlV1HyperparameterOutputHyperparameterMetric', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 3891 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 3892 | var o = buildGoogleCloudMlV1HyperparameterOutputHyperparameterMetric(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3893 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3894 | var od = |
| 3895 | api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric.fromJson( |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3896 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3897 | checkGoogleCloudMlV1HyperparameterOutputHyperparameterMetric( |
| 3898 | od as api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 3899 | }); |
| 3900 | }); |
| 3901 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3902 | unittest.group('obj-schema-GoogleCloudMlV1MeasurementMetric', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 3903 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3904 | var o = buildGoogleCloudMlV1MeasurementMetric(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3905 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 3906 | var od = api.GoogleCloudMlV1MeasurementMetric.fromJson( |
| 3907 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3908 | checkGoogleCloudMlV1MeasurementMetric( |
| 3909 | od as api.GoogleCloudMlV1MeasurementMetric); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3910 | }); |
| 3911 | }); |
| 3912 | |
| 3913 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3914 | 'obj-schema-GoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3915 | () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 3916 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3917 | var o = |
| 3918 | buildGoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3919 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3920 | var od = api.GoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3921 | .fromJson(oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3922 | checkGoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec(od |
| 3923 | as api.GoogleCloudMlV1StudyConfigParameterSpecCategoricalValueSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3924 | }); |
| 3925 | }); |
| 3926 | |
| 3927 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3928 | 'obj-schema-GoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3929 | () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 3930 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3931 | var o = buildGoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3932 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3933 | var od = |
| 3934 | api.GoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec.fromJson( |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3935 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3936 | checkGoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec( |
| 3937 | od as api.GoogleCloudMlV1StudyConfigParameterSpecDiscreteValueSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3938 | }); |
| 3939 | }); |
| 3940 | |
| 3941 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3942 | 'obj-schema-GoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 3943 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3944 | var o = buildGoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3945 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3946 | var od = |
| 3947 | api.GoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec.fromJson( |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3948 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3949 | checkGoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec( |
| 3950 | od as api.GoogleCloudMlV1StudyConfigParameterSpecDoubleValueSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3951 | }); |
| 3952 | }); |
| 3953 | |
| 3954 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3955 | 'obj-schema-GoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 3956 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3957 | var o = buildGoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3958 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3959 | var od = |
| 3960 | api.GoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec.fromJson( |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3961 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3962 | checkGoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec( |
| 3963 | od as api.GoogleCloudMlV1StudyConfigParameterSpecIntegerValueSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3964 | }); |
| 3965 | }); |
| 3966 | |
| 3967 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3968 | 'obj-schema-GoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3969 | () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 3970 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3971 | var o = |
| 3972 | buildGoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3973 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3974 | var od = |
| 3975 | api.GoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3976 | .fromJson(oJson as core.Map<core.String, core.dynamic>); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3977 | checkGoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec( |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3978 | od as api |
| 3979 | .GoogleCloudMlV1StudyConfigParameterSpecMatchingParentCategoricalValueSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3980 | }); |
| 3981 | }); |
| 3982 | |
| 3983 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3984 | 'obj-schema-GoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3985 | () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 3986 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3987 | var o = |
| 3988 | buildGoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3989 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3990 | var od = |
| 3991 | api.GoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 3992 | .fromJson(oJson as core.Map<core.String, core.dynamic>); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3993 | checkGoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec( |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 3994 | od as api |
| 3995 | .GoogleCloudMlV1StudyConfigParameterSpecMatchingParentDiscreteValueSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 3996 | }); |
| 3997 | }); |
| 3998 | |
| 3999 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4000 | 'obj-schema-GoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4001 | () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4002 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4003 | var o = |
| 4004 | buildGoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4005 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4006 | var od = |
| 4007 | api.GoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4008 | .fromJson(oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4009 | checkGoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec(od |
| 4010 | as api |
| 4011 | .GoogleCloudMlV1StudyConfigParameterSpecMatchingParentIntValueSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4012 | }); |
| 4013 | }); |
| 4014 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4015 | unittest.group('obj-schema-GoogleCloudMlV1StudyConfigMetricSpec', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4016 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4017 | var o = buildGoogleCloudMlV1StudyConfigMetricSpec(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4018 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4019 | var od = api.GoogleCloudMlV1StudyConfigMetricSpec.fromJson( |
| 4020 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4021 | checkGoogleCloudMlV1StudyConfigMetricSpec( |
| 4022 | od as api.GoogleCloudMlV1StudyConfigMetricSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4023 | }); |
| 4024 | }); |
| 4025 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4026 | unittest.group('obj-schema-GoogleCloudMlV1StudyConfigParameterSpec', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4027 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4028 | var o = buildGoogleCloudMlV1StudyConfigParameterSpec(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4029 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4030 | var od = api.GoogleCloudMlV1StudyConfigParameterSpec.fromJson( |
| 4031 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4032 | checkGoogleCloudMlV1StudyConfigParameterSpec( |
| 4033 | od as api.GoogleCloudMlV1StudyConfigParameterSpec); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4034 | }); |
| 4035 | }); |
| 4036 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4037 | unittest.group('obj-schema-GoogleCloudMlV1TrialParameter', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4038 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4039 | var o = buildGoogleCloudMlV1TrialParameter(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4040 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4041 | var od = api.GoogleCloudMlV1TrialParameter.fromJson( |
| 4042 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4043 | checkGoogleCloudMlV1TrialParameter( |
| 4044 | od as api.GoogleCloudMlV1TrialParameter); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4045 | }); |
| 4046 | }); |
| 4047 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4048 | unittest.group('obj-schema-GoogleCloudMlV1AcceleratorConfig', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4049 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 4050 | var o = buildGoogleCloudMlV1AcceleratorConfig(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4051 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4052 | var od = api.GoogleCloudMlV1AcceleratorConfig.fromJson( |
| 4053 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4054 | checkGoogleCloudMlV1AcceleratorConfig( |
| 4055 | od as api.GoogleCloudMlV1AcceleratorConfig); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 4056 | }); |
| 4057 | }); |
| 4058 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4059 | unittest.group('obj-schema-GoogleCloudMlV1AddTrialMeasurementRequest', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4060 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4061 | var o = buildGoogleCloudMlV1AddTrialMeasurementRequest(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4062 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4063 | var od = api.GoogleCloudMlV1AddTrialMeasurementRequest.fromJson( |
| 4064 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4065 | checkGoogleCloudMlV1AddTrialMeasurementRequest( |
| 4066 | od as api.GoogleCloudMlV1AddTrialMeasurementRequest); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4067 | }); |
| 4068 | }); |
| 4069 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4070 | unittest.group('obj-schema-GoogleCloudMlV1AutoScaling', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4071 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | fa83e31 | 2017-07-31 12:48:45 +0200 | [diff] [blame] | 4072 | var o = buildGoogleCloudMlV1AutoScaling(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4073 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4074 | var od = api.GoogleCloudMlV1AutoScaling.fromJson( |
| 4075 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4076 | checkGoogleCloudMlV1AutoScaling(od as api.GoogleCloudMlV1AutoScaling); |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 4077 | }); |
| 4078 | }); |
| 4079 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4080 | unittest.group('obj-schema-GoogleCloudMlV1AutomatedStoppingConfig', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4081 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4082 | var o = buildGoogleCloudMlV1AutomatedStoppingConfig(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4083 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4084 | var od = api.GoogleCloudMlV1AutomatedStoppingConfig.fromJson( |
| 4085 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4086 | checkGoogleCloudMlV1AutomatedStoppingConfig( |
| 4087 | od as api.GoogleCloudMlV1AutomatedStoppingConfig); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4088 | }); |
| 4089 | }); |
| 4090 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4091 | unittest.group('obj-schema-GoogleCloudMlV1BuiltInAlgorithmOutput', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4092 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 4093 | var o = buildGoogleCloudMlV1BuiltInAlgorithmOutput(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4094 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4095 | var od = api.GoogleCloudMlV1BuiltInAlgorithmOutput.fromJson( |
| 4096 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4097 | checkGoogleCloudMlV1BuiltInAlgorithmOutput( |
| 4098 | od as api.GoogleCloudMlV1BuiltInAlgorithmOutput); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 4099 | }); |
| 4100 | }); |
| 4101 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4102 | unittest.group('obj-schema-GoogleCloudMlV1CancelJobRequest', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4103 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4104 | var o = buildGoogleCloudMlV1CancelJobRequest(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4105 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4106 | var od = api.GoogleCloudMlV1CancelJobRequest.fromJson( |
| 4107 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4108 | checkGoogleCloudMlV1CancelJobRequest( |
| 4109 | od as api.GoogleCloudMlV1CancelJobRequest); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4110 | }); |
| 4111 | }); |
| 4112 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4113 | unittest.group('obj-schema-GoogleCloudMlV1Capability', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4114 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 4115 | var o = buildGoogleCloudMlV1Capability(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4116 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4117 | var od = api.GoogleCloudMlV1Capability.fromJson( |
| 4118 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4119 | checkGoogleCloudMlV1Capability(od as api.GoogleCloudMlV1Capability); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 4120 | }); |
| 4121 | }); |
| 4122 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4123 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4124 | 'obj-schema-GoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4125 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4126 | var o = buildGoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4127 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4128 | var od = |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4129 | api.GoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata.fromJson( |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4130 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4131 | checkGoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata( |
| 4132 | od as api.GoogleCloudMlV1CheckTrialEarlyStoppingStateMetatdata); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4133 | }); |
| 4134 | }); |
| 4135 | |
| 4136 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4137 | 'obj-schema-GoogleCloudMlV1CheckTrialEarlyStoppingStateRequest', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4138 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4139 | var o = buildGoogleCloudMlV1CheckTrialEarlyStoppingStateRequest(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4140 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4141 | var od = api.GoogleCloudMlV1CheckTrialEarlyStoppingStateRequest.fromJson( |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4142 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4143 | checkGoogleCloudMlV1CheckTrialEarlyStoppingStateRequest( |
| 4144 | od as api.GoogleCloudMlV1CheckTrialEarlyStoppingStateRequest); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4145 | }); |
| 4146 | }); |
| 4147 | |
| 4148 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4149 | 'obj-schema-GoogleCloudMlV1CheckTrialEarlyStoppingStateResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4150 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4151 | var o = buildGoogleCloudMlV1CheckTrialEarlyStoppingStateResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4152 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4153 | var od = api.GoogleCloudMlV1CheckTrialEarlyStoppingStateResponse.fromJson( |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4154 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4155 | checkGoogleCloudMlV1CheckTrialEarlyStoppingStateResponse( |
| 4156 | od as api.GoogleCloudMlV1CheckTrialEarlyStoppingStateResponse); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4157 | }); |
| 4158 | }); |
| 4159 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4160 | unittest.group('obj-schema-GoogleCloudMlV1CompleteTrialRequest', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4161 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4162 | var o = buildGoogleCloudMlV1CompleteTrialRequest(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4163 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4164 | var od = api.GoogleCloudMlV1CompleteTrialRequest.fromJson( |
| 4165 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4166 | checkGoogleCloudMlV1CompleteTrialRequest( |
| 4167 | od as api.GoogleCloudMlV1CompleteTrialRequest); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4168 | }); |
| 4169 | }); |
| 4170 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4171 | unittest.group('obj-schema-GoogleCloudMlV1Config', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4172 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 4173 | var o = buildGoogleCloudMlV1Config(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4174 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4175 | var od = api.GoogleCloudMlV1Config.fromJson( |
| 4176 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4177 | checkGoogleCloudMlV1Config(od as api.GoogleCloudMlV1Config); |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 4178 | }); |
| 4179 | }); |
| 4180 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4181 | unittest.group('obj-schema-GoogleCloudMlV1ContainerPort', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4182 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 4183 | var o = buildGoogleCloudMlV1ContainerPort(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4184 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4185 | var od = api.GoogleCloudMlV1ContainerPort.fromJson( |
| 4186 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4187 | checkGoogleCloudMlV1ContainerPort(od as api.GoogleCloudMlV1ContainerPort); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 4188 | }); |
| 4189 | }); |
| 4190 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4191 | unittest.group('obj-schema-GoogleCloudMlV1ContainerSpec', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4192 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 4193 | var o = buildGoogleCloudMlV1ContainerSpec(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4194 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4195 | var od = api.GoogleCloudMlV1ContainerSpec.fromJson( |
| 4196 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4197 | checkGoogleCloudMlV1ContainerSpec(od as api.GoogleCloudMlV1ContainerSpec); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 4198 | }); |
| 4199 | }); |
| 4200 | |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 4201 | unittest.group('obj-schema-GoogleCloudMlV1DiskConfig', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4202 | unittest.test('to-json--from-json', () async { |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 4203 | var o = buildGoogleCloudMlV1DiskConfig(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4204 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4205 | var od = api.GoogleCloudMlV1DiskConfig.fromJson( |
| 4206 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 4207 | checkGoogleCloudMlV1DiskConfig(od as api.GoogleCloudMlV1DiskConfig); |
| 4208 | }); |
| 4209 | }); |
| 4210 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4211 | unittest.group('obj-schema-GoogleCloudMlV1EncryptionConfig', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4212 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4213 | var o = buildGoogleCloudMlV1EncryptionConfig(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4214 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4215 | var od = api.GoogleCloudMlV1EncryptionConfig.fromJson( |
| 4216 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4217 | checkGoogleCloudMlV1EncryptionConfig( |
| 4218 | od as api.GoogleCloudMlV1EncryptionConfig); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4219 | }); |
| 4220 | }); |
| 4221 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4222 | unittest.group('obj-schema-GoogleCloudMlV1EnvVar', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4223 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 4224 | var o = buildGoogleCloudMlV1EnvVar(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4225 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4226 | var od = api.GoogleCloudMlV1EnvVar.fromJson( |
| 4227 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4228 | checkGoogleCloudMlV1EnvVar(od as api.GoogleCloudMlV1EnvVar); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 4229 | }); |
| 4230 | }); |
| 4231 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4232 | unittest.group('obj-schema-GoogleCloudMlV1ExplainRequest', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4233 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4234 | var o = buildGoogleCloudMlV1ExplainRequest(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4235 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4236 | var od = api.GoogleCloudMlV1ExplainRequest.fromJson( |
| 4237 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4238 | checkGoogleCloudMlV1ExplainRequest( |
| 4239 | od as api.GoogleCloudMlV1ExplainRequest); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4240 | }); |
| 4241 | }); |
| 4242 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4243 | unittest.group('obj-schema-GoogleCloudMlV1ExplanationConfig', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4244 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4245 | var o = buildGoogleCloudMlV1ExplanationConfig(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4246 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4247 | var od = api.GoogleCloudMlV1ExplanationConfig.fromJson( |
| 4248 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4249 | checkGoogleCloudMlV1ExplanationConfig( |
| 4250 | od as api.GoogleCloudMlV1ExplanationConfig); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4251 | }); |
| 4252 | }); |
| 4253 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4254 | unittest.group('obj-schema-GoogleCloudMlV1GetConfigResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4255 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4256 | var o = buildGoogleCloudMlV1GetConfigResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4257 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4258 | var od = api.GoogleCloudMlV1GetConfigResponse.fromJson( |
| 4259 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4260 | checkGoogleCloudMlV1GetConfigResponse( |
| 4261 | od as api.GoogleCloudMlV1GetConfigResponse); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4262 | }); |
| 4263 | }); |
| 4264 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4265 | unittest.group('obj-schema-GoogleCloudMlV1HyperparameterOutput', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4266 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4267 | var o = buildGoogleCloudMlV1HyperparameterOutput(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4268 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4269 | var od = api.GoogleCloudMlV1HyperparameterOutput.fromJson( |
| 4270 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4271 | checkGoogleCloudMlV1HyperparameterOutput( |
| 4272 | od as api.GoogleCloudMlV1HyperparameterOutput); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4273 | }); |
| 4274 | }); |
| 4275 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4276 | unittest.group('obj-schema-GoogleCloudMlV1HyperparameterSpec', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4277 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4278 | var o = buildGoogleCloudMlV1HyperparameterSpec(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4279 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4280 | var od = api.GoogleCloudMlV1HyperparameterSpec.fromJson( |
| 4281 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4282 | checkGoogleCloudMlV1HyperparameterSpec( |
| 4283 | od as api.GoogleCloudMlV1HyperparameterSpec); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4284 | }); |
| 4285 | }); |
| 4286 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4287 | unittest.group('obj-schema-GoogleCloudMlV1IntegratedGradientsAttribution', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4288 | () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4289 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4290 | var o = buildGoogleCloudMlV1IntegratedGradientsAttribution(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4291 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4292 | var od = api.GoogleCloudMlV1IntegratedGradientsAttribution.fromJson( |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4293 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4294 | checkGoogleCloudMlV1IntegratedGradientsAttribution( |
| 4295 | od as api.GoogleCloudMlV1IntegratedGradientsAttribution); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4296 | }); |
| 4297 | }); |
| 4298 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4299 | unittest.group('obj-schema-GoogleCloudMlV1Job', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4300 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4301 | var o = buildGoogleCloudMlV1Job(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4302 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4303 | var od = api.GoogleCloudMlV1Job.fromJson( |
| 4304 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4305 | checkGoogleCloudMlV1Job(od as api.GoogleCloudMlV1Job); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4306 | }); |
| 4307 | }); |
| 4308 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4309 | unittest.group('obj-schema-GoogleCloudMlV1ListJobsResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4310 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4311 | var o = buildGoogleCloudMlV1ListJobsResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4312 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4313 | var od = api.GoogleCloudMlV1ListJobsResponse.fromJson( |
| 4314 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4315 | checkGoogleCloudMlV1ListJobsResponse( |
| 4316 | od as api.GoogleCloudMlV1ListJobsResponse); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4317 | }); |
| 4318 | }); |
| 4319 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4320 | unittest.group('obj-schema-GoogleCloudMlV1ListLocationsResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4321 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 4322 | var o = buildGoogleCloudMlV1ListLocationsResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4323 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4324 | var od = api.GoogleCloudMlV1ListLocationsResponse.fromJson( |
| 4325 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4326 | checkGoogleCloudMlV1ListLocationsResponse( |
| 4327 | od as api.GoogleCloudMlV1ListLocationsResponse); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 4328 | }); |
| 4329 | }); |
| 4330 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4331 | unittest.group('obj-schema-GoogleCloudMlV1ListModelsResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4332 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4333 | var o = buildGoogleCloudMlV1ListModelsResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4334 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4335 | var od = api.GoogleCloudMlV1ListModelsResponse.fromJson( |
| 4336 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4337 | checkGoogleCloudMlV1ListModelsResponse( |
| 4338 | od as api.GoogleCloudMlV1ListModelsResponse); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4339 | }); |
| 4340 | }); |
| 4341 | |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 4342 | unittest.group('obj-schema-GoogleCloudMlV1ListOptimalTrialsRequest', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4343 | unittest.test('to-json--from-json', () async { |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 4344 | var o = buildGoogleCloudMlV1ListOptimalTrialsRequest(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4345 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4346 | var od = api.GoogleCloudMlV1ListOptimalTrialsRequest.fromJson( |
| 4347 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 4348 | checkGoogleCloudMlV1ListOptimalTrialsRequest( |
| 4349 | od as api.GoogleCloudMlV1ListOptimalTrialsRequest); |
| 4350 | }); |
| 4351 | }); |
| 4352 | |
| 4353 | unittest.group('obj-schema-GoogleCloudMlV1ListOptimalTrialsResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4354 | unittest.test('to-json--from-json', () async { |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 4355 | var o = buildGoogleCloudMlV1ListOptimalTrialsResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4356 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4357 | var od = api.GoogleCloudMlV1ListOptimalTrialsResponse.fromJson( |
| 4358 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 4359 | checkGoogleCloudMlV1ListOptimalTrialsResponse( |
| 4360 | od as api.GoogleCloudMlV1ListOptimalTrialsResponse); |
| 4361 | }); |
| 4362 | }); |
| 4363 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4364 | unittest.group('obj-schema-GoogleCloudMlV1ListStudiesResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4365 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4366 | var o = buildGoogleCloudMlV1ListStudiesResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4367 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4368 | var od = api.GoogleCloudMlV1ListStudiesResponse.fromJson( |
| 4369 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4370 | checkGoogleCloudMlV1ListStudiesResponse( |
| 4371 | od as api.GoogleCloudMlV1ListStudiesResponse); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4372 | }); |
| 4373 | }); |
| 4374 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4375 | unittest.group('obj-schema-GoogleCloudMlV1ListTrialsResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4376 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4377 | var o = buildGoogleCloudMlV1ListTrialsResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4378 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4379 | var od = api.GoogleCloudMlV1ListTrialsResponse.fromJson( |
| 4380 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4381 | checkGoogleCloudMlV1ListTrialsResponse( |
| 4382 | od as api.GoogleCloudMlV1ListTrialsResponse); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4383 | }); |
| 4384 | }); |
| 4385 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4386 | unittest.group('obj-schema-GoogleCloudMlV1ListVersionsResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4387 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4388 | var o = buildGoogleCloudMlV1ListVersionsResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4389 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4390 | var od = api.GoogleCloudMlV1ListVersionsResponse.fromJson( |
| 4391 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4392 | checkGoogleCloudMlV1ListVersionsResponse( |
| 4393 | od as api.GoogleCloudMlV1ListVersionsResponse); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4394 | }); |
| 4395 | }); |
| 4396 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4397 | unittest.group('obj-schema-GoogleCloudMlV1Location', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4398 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 4399 | var o = buildGoogleCloudMlV1Location(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4400 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4401 | var od = api.GoogleCloudMlV1Location.fromJson( |
| 4402 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4403 | checkGoogleCloudMlV1Location(od as api.GoogleCloudMlV1Location); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 4404 | }); |
| 4405 | }); |
| 4406 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4407 | unittest.group('obj-schema-GoogleCloudMlV1ManualScaling', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4408 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 77f42ff | 2017-03-06 13:56:35 +0100 | [diff] [blame] | 4409 | var o = buildGoogleCloudMlV1ManualScaling(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4410 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4411 | var od = api.GoogleCloudMlV1ManualScaling.fromJson( |
| 4412 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4413 | checkGoogleCloudMlV1ManualScaling(od as api.GoogleCloudMlV1ManualScaling); |
Martin Kustermann | 77f42ff | 2017-03-06 13:56:35 +0100 | [diff] [blame] | 4414 | }); |
| 4415 | }); |
| 4416 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4417 | unittest.group('obj-schema-GoogleCloudMlV1Measurement', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4418 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4419 | var o = buildGoogleCloudMlV1Measurement(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4420 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4421 | var od = api.GoogleCloudMlV1Measurement.fromJson( |
| 4422 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4423 | checkGoogleCloudMlV1Measurement(od as api.GoogleCloudMlV1Measurement); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4424 | }); |
| 4425 | }); |
| 4426 | |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 4427 | unittest.group('obj-schema-GoogleCloudMlV1MetricSpec', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4428 | unittest.test('to-json--from-json', () async { |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 4429 | var o = buildGoogleCloudMlV1MetricSpec(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4430 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4431 | var od = api.GoogleCloudMlV1MetricSpec.fromJson( |
| 4432 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 4433 | checkGoogleCloudMlV1MetricSpec(od as api.GoogleCloudMlV1MetricSpec); |
| 4434 | }); |
| 4435 | }); |
| 4436 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4437 | unittest.group('obj-schema-GoogleCloudMlV1Model', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4438 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4439 | var o = buildGoogleCloudMlV1Model(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4440 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4441 | var od = api.GoogleCloudMlV1Model.fromJson( |
| 4442 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4443 | checkGoogleCloudMlV1Model(od as api.GoogleCloudMlV1Model); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4444 | }); |
| 4445 | }); |
| 4446 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4447 | unittest.group('obj-schema-GoogleCloudMlV1OperationMetadata', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4448 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 4449 | var o = buildGoogleCloudMlV1OperationMetadata(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4450 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4451 | var od = api.GoogleCloudMlV1OperationMetadata.fromJson( |
| 4452 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4453 | checkGoogleCloudMlV1OperationMetadata( |
| 4454 | od as api.GoogleCloudMlV1OperationMetadata); |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 4455 | }); |
| 4456 | }); |
| 4457 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4458 | unittest.group('obj-schema-GoogleCloudMlV1ParameterSpec', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4459 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4460 | var o = buildGoogleCloudMlV1ParameterSpec(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4461 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4462 | var od = api.GoogleCloudMlV1ParameterSpec.fromJson( |
| 4463 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4464 | checkGoogleCloudMlV1ParameterSpec(od as api.GoogleCloudMlV1ParameterSpec); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4465 | }); |
| 4466 | }); |
| 4467 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4468 | unittest.group('obj-schema-GoogleCloudMlV1PredictRequest', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4469 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4470 | var o = buildGoogleCloudMlV1PredictRequest(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4471 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4472 | var od = api.GoogleCloudMlV1PredictRequest.fromJson( |
| 4473 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4474 | checkGoogleCloudMlV1PredictRequest( |
| 4475 | od as api.GoogleCloudMlV1PredictRequest); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4476 | }); |
| 4477 | }); |
| 4478 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4479 | unittest.group('obj-schema-GoogleCloudMlV1PredictionInput', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4480 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4481 | var o = buildGoogleCloudMlV1PredictionInput(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4482 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4483 | var od = api.GoogleCloudMlV1PredictionInput.fromJson( |
| 4484 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4485 | checkGoogleCloudMlV1PredictionInput( |
| 4486 | od as api.GoogleCloudMlV1PredictionInput); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4487 | }); |
| 4488 | }); |
| 4489 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4490 | unittest.group('obj-schema-GoogleCloudMlV1PredictionOutput', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4491 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4492 | var o = buildGoogleCloudMlV1PredictionOutput(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4493 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4494 | var od = api.GoogleCloudMlV1PredictionOutput.fromJson( |
| 4495 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4496 | checkGoogleCloudMlV1PredictionOutput( |
| 4497 | od as api.GoogleCloudMlV1PredictionOutput); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4498 | }); |
| 4499 | }); |
| 4500 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4501 | unittest.group('obj-schema-GoogleCloudMlV1ReplicaConfig', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4502 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 4503 | var o = buildGoogleCloudMlV1ReplicaConfig(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4504 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4505 | var od = api.GoogleCloudMlV1ReplicaConfig.fromJson( |
| 4506 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4507 | checkGoogleCloudMlV1ReplicaConfig(od as api.GoogleCloudMlV1ReplicaConfig); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 4508 | }); |
| 4509 | }); |
| 4510 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4511 | unittest.group('obj-schema-GoogleCloudMlV1RequestLoggingConfig', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4512 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4513 | var o = buildGoogleCloudMlV1RequestLoggingConfig(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4514 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4515 | var od = api.GoogleCloudMlV1RequestLoggingConfig.fromJson( |
| 4516 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4517 | checkGoogleCloudMlV1RequestLoggingConfig( |
| 4518 | od as api.GoogleCloudMlV1RequestLoggingConfig); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4519 | }); |
| 4520 | }); |
| 4521 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4522 | unittest.group('obj-schema-GoogleCloudMlV1RouteMap', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4523 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 4524 | var o = buildGoogleCloudMlV1RouteMap(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4525 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4526 | var od = api.GoogleCloudMlV1RouteMap.fromJson( |
| 4527 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4528 | checkGoogleCloudMlV1RouteMap(od as api.GoogleCloudMlV1RouteMap); |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 4529 | }); |
| 4530 | }); |
| 4531 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4532 | unittest.group('obj-schema-GoogleCloudMlV1SampledShapleyAttribution', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4533 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4534 | var o = buildGoogleCloudMlV1SampledShapleyAttribution(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4535 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4536 | var od = api.GoogleCloudMlV1SampledShapleyAttribution.fromJson( |
| 4537 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4538 | checkGoogleCloudMlV1SampledShapleyAttribution( |
| 4539 | od as api.GoogleCloudMlV1SampledShapleyAttribution); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4540 | }); |
| 4541 | }); |
| 4542 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4543 | unittest.group('obj-schema-GoogleCloudMlV1Scheduling', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4544 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4545 | var o = buildGoogleCloudMlV1Scheduling(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4546 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4547 | var od = api.GoogleCloudMlV1Scheduling.fromJson( |
| 4548 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4549 | checkGoogleCloudMlV1Scheduling(od as api.GoogleCloudMlV1Scheduling); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4550 | }); |
| 4551 | }); |
| 4552 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4553 | unittest.group('obj-schema-GoogleCloudMlV1SetDefaultVersionRequest', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4554 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4555 | var o = buildGoogleCloudMlV1SetDefaultVersionRequest(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4556 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4557 | var od = api.GoogleCloudMlV1SetDefaultVersionRequest.fromJson( |
| 4558 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4559 | checkGoogleCloudMlV1SetDefaultVersionRequest( |
| 4560 | od as api.GoogleCloudMlV1SetDefaultVersionRequest); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4561 | }); |
| 4562 | }); |
| 4563 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4564 | unittest.group('obj-schema-GoogleCloudMlV1StopTrialRequest', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4565 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4566 | var o = buildGoogleCloudMlV1StopTrialRequest(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4567 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4568 | var od = api.GoogleCloudMlV1StopTrialRequest.fromJson( |
| 4569 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4570 | checkGoogleCloudMlV1StopTrialRequest( |
| 4571 | od as api.GoogleCloudMlV1StopTrialRequest); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4572 | }); |
| 4573 | }); |
| 4574 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4575 | unittest.group('obj-schema-GoogleCloudMlV1Study', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4576 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4577 | var o = buildGoogleCloudMlV1Study(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4578 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4579 | var od = api.GoogleCloudMlV1Study.fromJson( |
| 4580 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4581 | checkGoogleCloudMlV1Study(od as api.GoogleCloudMlV1Study); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4582 | }); |
| 4583 | }); |
| 4584 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4585 | unittest.group('obj-schema-GoogleCloudMlV1StudyConfig', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4586 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4587 | var o = buildGoogleCloudMlV1StudyConfig(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4588 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4589 | var od = api.GoogleCloudMlV1StudyConfig.fromJson( |
| 4590 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4591 | checkGoogleCloudMlV1StudyConfig(od as api.GoogleCloudMlV1StudyConfig); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4592 | }); |
| 4593 | }); |
| 4594 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4595 | unittest.group('obj-schema-GoogleCloudMlV1SuggestTrialsMetadata', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4596 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4597 | var o = buildGoogleCloudMlV1SuggestTrialsMetadata(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4598 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4599 | var od = api.GoogleCloudMlV1SuggestTrialsMetadata.fromJson( |
| 4600 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4601 | checkGoogleCloudMlV1SuggestTrialsMetadata( |
| 4602 | od as api.GoogleCloudMlV1SuggestTrialsMetadata); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4603 | }); |
| 4604 | }); |
| 4605 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4606 | unittest.group('obj-schema-GoogleCloudMlV1SuggestTrialsRequest', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4607 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4608 | var o = buildGoogleCloudMlV1SuggestTrialsRequest(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4609 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4610 | var od = api.GoogleCloudMlV1SuggestTrialsRequest.fromJson( |
| 4611 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4612 | checkGoogleCloudMlV1SuggestTrialsRequest( |
| 4613 | od as api.GoogleCloudMlV1SuggestTrialsRequest); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4614 | }); |
| 4615 | }); |
| 4616 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4617 | unittest.group('obj-schema-GoogleCloudMlV1SuggestTrialsResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4618 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4619 | var o = buildGoogleCloudMlV1SuggestTrialsResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4620 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4621 | var od = api.GoogleCloudMlV1SuggestTrialsResponse.fromJson( |
| 4622 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4623 | checkGoogleCloudMlV1SuggestTrialsResponse( |
| 4624 | od as api.GoogleCloudMlV1SuggestTrialsResponse); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4625 | }); |
| 4626 | }); |
| 4627 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4628 | unittest.group('obj-schema-GoogleCloudMlV1TrainingInput', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4629 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4630 | var o = buildGoogleCloudMlV1TrainingInput(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4631 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4632 | var od = api.GoogleCloudMlV1TrainingInput.fromJson( |
| 4633 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4634 | checkGoogleCloudMlV1TrainingInput(od as api.GoogleCloudMlV1TrainingInput); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4635 | }); |
| 4636 | }); |
| 4637 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4638 | unittest.group('obj-schema-GoogleCloudMlV1TrainingOutput', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4639 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4640 | var o = buildGoogleCloudMlV1TrainingOutput(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4641 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4642 | var od = api.GoogleCloudMlV1TrainingOutput.fromJson( |
| 4643 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4644 | checkGoogleCloudMlV1TrainingOutput( |
| 4645 | od as api.GoogleCloudMlV1TrainingOutput); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4646 | }); |
| 4647 | }); |
| 4648 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4649 | unittest.group('obj-schema-GoogleCloudMlV1Trial', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4650 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4651 | var o = buildGoogleCloudMlV1Trial(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4652 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4653 | var od = api.GoogleCloudMlV1Trial.fromJson( |
| 4654 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4655 | checkGoogleCloudMlV1Trial(od as api.GoogleCloudMlV1Trial); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4656 | }); |
| 4657 | }); |
| 4658 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4659 | unittest.group('obj-schema-GoogleCloudMlV1Version', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4660 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 4661 | var o = buildGoogleCloudMlV1Version(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4662 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4663 | var od = api.GoogleCloudMlV1Version.fromJson( |
| 4664 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4665 | checkGoogleCloudMlV1Version(od as api.GoogleCloudMlV1Version); |
Martin Kustermann | 571f592 | 2017-02-14 09:00:01 +0100 | [diff] [blame] | 4666 | }); |
| 4667 | }); |
| 4668 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4669 | unittest.group('obj-schema-GoogleCloudMlV1XraiAttribution', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4670 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4671 | var o = buildGoogleCloudMlV1XraiAttribution(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4672 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4673 | var od = api.GoogleCloudMlV1XraiAttribution.fromJson( |
| 4674 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4675 | checkGoogleCloudMlV1XraiAttribution( |
| 4676 | od as api.GoogleCloudMlV1XraiAttribution); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4677 | }); |
| 4678 | }); |
| 4679 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4680 | unittest.group('obj-schema-GoogleIamV1AuditConfig', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4681 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 4682 | var o = buildGoogleIamV1AuditConfig(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4683 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4684 | var od = api.GoogleIamV1AuditConfig.fromJson( |
| 4685 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4686 | checkGoogleIamV1AuditConfig(od as api.GoogleIamV1AuditConfig); |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 4687 | }); |
| 4688 | }); |
| 4689 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4690 | unittest.group('obj-schema-GoogleIamV1AuditLogConfig', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4691 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 4692 | var o = buildGoogleIamV1AuditLogConfig(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4693 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4694 | var od = api.GoogleIamV1AuditLogConfig.fromJson( |
| 4695 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4696 | checkGoogleIamV1AuditLogConfig(od as api.GoogleIamV1AuditLogConfig); |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 4697 | }); |
| 4698 | }); |
| 4699 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4700 | unittest.group('obj-schema-GoogleIamV1Binding', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4701 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 4702 | var o = buildGoogleIamV1Binding(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4703 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4704 | var od = api.GoogleIamV1Binding.fromJson( |
| 4705 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4706 | checkGoogleIamV1Binding(od as api.GoogleIamV1Binding); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 4707 | }); |
| 4708 | }); |
| 4709 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4710 | unittest.group('obj-schema-GoogleIamV1Policy', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4711 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 4712 | var o = buildGoogleIamV1Policy(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4713 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4714 | var od = api.GoogleIamV1Policy.fromJson( |
| 4715 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4716 | checkGoogleIamV1Policy(od as api.GoogleIamV1Policy); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 4717 | }); |
| 4718 | }); |
| 4719 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4720 | unittest.group('obj-schema-GoogleIamV1SetIamPolicyRequest', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4721 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 4722 | var o = buildGoogleIamV1SetIamPolicyRequest(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4723 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4724 | var od = api.GoogleIamV1SetIamPolicyRequest.fromJson( |
| 4725 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4726 | checkGoogleIamV1SetIamPolicyRequest( |
| 4727 | od as api.GoogleIamV1SetIamPolicyRequest); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 4728 | }); |
| 4729 | }); |
| 4730 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4731 | unittest.group('obj-schema-GoogleIamV1TestIamPermissionsRequest', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4732 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 4733 | var o = buildGoogleIamV1TestIamPermissionsRequest(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4734 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4735 | var od = api.GoogleIamV1TestIamPermissionsRequest.fromJson( |
| 4736 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4737 | checkGoogleIamV1TestIamPermissionsRequest( |
| 4738 | od as api.GoogleIamV1TestIamPermissionsRequest); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 4739 | }); |
| 4740 | }); |
| 4741 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4742 | unittest.group('obj-schema-GoogleIamV1TestIamPermissionsResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4743 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 4744 | var o = buildGoogleIamV1TestIamPermissionsResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4745 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4746 | var od = api.GoogleIamV1TestIamPermissionsResponse.fromJson( |
| 4747 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4748 | checkGoogleIamV1TestIamPermissionsResponse( |
| 4749 | od as api.GoogleIamV1TestIamPermissionsResponse); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 4750 | }); |
| 4751 | }); |
| 4752 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4753 | unittest.group('obj-schema-GoogleLongrunningListOperationsResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4754 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4755 | var o = buildGoogleLongrunningListOperationsResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4756 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4757 | var od = api.GoogleLongrunningListOperationsResponse.fromJson( |
| 4758 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4759 | checkGoogleLongrunningListOperationsResponse( |
| 4760 | od as api.GoogleLongrunningListOperationsResponse); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4761 | }); |
| 4762 | }); |
| 4763 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4764 | unittest.group('obj-schema-GoogleLongrunningOperation', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4765 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4766 | var o = buildGoogleLongrunningOperation(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4767 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4768 | var od = api.GoogleLongrunningOperation.fromJson( |
| 4769 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4770 | checkGoogleLongrunningOperation(od as api.GoogleLongrunningOperation); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4771 | }); |
| 4772 | }); |
| 4773 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4774 | unittest.group('obj-schema-GoogleProtobufEmpty', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4775 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4776 | var o = buildGoogleProtobufEmpty(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4777 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4778 | var od = api.GoogleProtobufEmpty.fromJson( |
| 4779 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4780 | checkGoogleProtobufEmpty(od as api.GoogleProtobufEmpty); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4781 | }); |
| 4782 | }); |
| 4783 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4784 | unittest.group('obj-schema-GoogleRpcStatus', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4785 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4786 | var o = buildGoogleRpcStatus(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4787 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4788 | var od = api.GoogleRpcStatus.fromJson( |
| 4789 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4790 | checkGoogleRpcStatus(od as api.GoogleRpcStatus); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4791 | }); |
| 4792 | }); |
| 4793 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4794 | unittest.group('obj-schema-GoogleTypeExpr', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4795 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 4796 | var o = buildGoogleTypeExpr(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 4797 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 4798 | var od = api.GoogleTypeExpr.fromJson( |
| 4799 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4800 | checkGoogleTypeExpr(od as api.GoogleTypeExpr); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 4801 | }); |
| 4802 | }); |
| 4803 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 4804 | unittest.group('resource-ProjectsResource', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4805 | unittest.test('method--explain', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4806 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 4807 | var res = api.CloudMachineLearningEngineApi(mock).projects; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4808 | var arg_request = buildGoogleCloudMlV1ExplainRequest(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4809 | var arg_name = 'foo'; |
| 4810 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4811 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4812 | var obj = api.GoogleCloudMlV1ExplainRequest.fromJson( |
| 4813 | json as core.Map<core.String, core.dynamic>); |
| 4814 | checkGoogleCloudMlV1ExplainRequest( |
| 4815 | obj as api.GoogleCloudMlV1ExplainRequest); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4816 | |
| 4817 | var path = (req.url).path; |
| 4818 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4819 | core.int index; |
| 4820 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4821 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 4822 | path.substring(pathOffset, pathOffset + 1), |
| 4823 | unittest.equals("/"), |
| 4824 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4825 | pathOffset += 1; |
| 4826 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 4827 | path.substring(pathOffset, pathOffset + 3), |
| 4828 | unittest.equals("v1/"), |
| 4829 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4830 | pathOffset += 3; |
| 4831 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 4832 | |
| 4833 | var query = (req.url).query; |
| 4834 | var queryOffset = 0; |
| 4835 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 4836 | void addQueryParam(core.String n, core.String v) => |
| 4837 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4838 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4839 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4840 | for (var part in query.split('&')) { |
| 4841 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4842 | addQueryParam( |
| 4843 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 4844 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 4845 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4846 | } |
| 4847 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 4848 | unittest.expect( |
| 4849 | queryMap["fields"]!.first, |
| 4850 | unittest.equals(arg_$fields), |
| 4851 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4852 | |
| 4853 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4854 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4855 | }; |
| 4856 | var resp = convert.json.encode(buildGoogleApiHttpBody()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4857 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4858 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4859 | final response = |
| 4860 | await res.explain(arg_request, arg_name, $fields: arg_$fields); |
| 4861 | checkGoogleApiHttpBody(response as api.GoogleApiHttpBody); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 4862 | }); |
| 4863 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4864 | unittest.test('method--getConfig', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4865 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 4866 | var res = api.CloudMachineLearningEngineApi(mock).projects; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4867 | var arg_name = 'foo'; |
| 4868 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 4869 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4870 | var path = (req.url).path; |
| 4871 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4872 | core.int index; |
| 4873 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 4874 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 4875 | path.substring(pathOffset, pathOffset + 1), |
| 4876 | unittest.equals("/"), |
| 4877 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4878 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 4879 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 4880 | path.substring(pathOffset, pathOffset + 3), |
| 4881 | unittest.equals("v1/"), |
| 4882 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4883 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4884 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 4885 | |
| 4886 | var query = (req.url).query; |
| 4887 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 4888 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 4889 | void addQueryParam(core.String n, core.String v) => |
| 4890 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 4891 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4892 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4893 | for (var part in query.split('&')) { |
| 4894 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4895 | addQueryParam( |
| 4896 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 4897 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 4898 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4899 | } |
| 4900 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 4901 | unittest.expect( |
| 4902 | queryMap["fields"]!.first, |
| 4903 | unittest.equals(arg_$fields), |
| 4904 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4905 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4906 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4907 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4908 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 4909 | var resp = convert.json.encode(buildGoogleCloudMlV1GetConfigResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4910 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4911 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4912 | final response = await res.getConfig(arg_name, $fields: arg_$fields); |
| 4913 | checkGoogleCloudMlV1GetConfigResponse( |
| 4914 | response as api.GoogleCloudMlV1GetConfigResponse); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4915 | }); |
| 4916 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4917 | unittest.test('method--predict', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4918 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 4919 | var res = api.CloudMachineLearningEngineApi(mock).projects; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4920 | var arg_request = buildGoogleCloudMlV1PredictRequest(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4921 | var arg_name = 'foo'; |
| 4922 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 4923 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4924 | var obj = api.GoogleCloudMlV1PredictRequest.fromJson( |
| 4925 | json as core.Map<core.String, core.dynamic>); |
| 4926 | checkGoogleCloudMlV1PredictRequest( |
| 4927 | obj as api.GoogleCloudMlV1PredictRequest); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4928 | |
| 4929 | var path = (req.url).path; |
| 4930 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4931 | core.int index; |
| 4932 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 4933 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 4934 | path.substring(pathOffset, pathOffset + 1), |
| 4935 | unittest.equals("/"), |
| 4936 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4937 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 4938 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 4939 | path.substring(pathOffset, pathOffset + 3), |
| 4940 | unittest.equals("v1/"), |
| 4941 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4942 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4943 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 4944 | |
| 4945 | var query = (req.url).query; |
| 4946 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 4947 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 4948 | void addQueryParam(core.String n, core.String v) => |
| 4949 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 4950 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4951 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4952 | for (var part in query.split('&')) { |
| 4953 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4954 | addQueryParam( |
| 4955 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 4956 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 4957 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4958 | } |
| 4959 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 4960 | unittest.expect( |
| 4961 | queryMap["fields"]!.first, |
| 4962 | unittest.equals(arg_$fields), |
| 4963 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4964 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4965 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4966 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4967 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 4968 | var resp = convert.json.encode(buildGoogleApiHttpBody()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4969 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4970 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4971 | final response = |
| 4972 | await res.predict(arg_request, arg_name, $fields: arg_$fields); |
| 4973 | checkGoogleApiHttpBody(response as api.GoogleApiHttpBody); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4974 | }); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4975 | }); |
| 4976 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 4977 | unittest.group('resource-ProjectsJobsResource', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 4978 | unittest.test('method--cancel', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4979 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 4980 | var res = api.CloudMachineLearningEngineApi(mock).projects.jobs; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 4981 | var arg_request = buildGoogleCloudMlV1CancelJobRequest(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4982 | var arg_name = 'foo'; |
| 4983 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 4984 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 4985 | var obj = api.GoogleCloudMlV1CancelJobRequest.fromJson( |
| 4986 | json as core.Map<core.String, core.dynamic>); |
| 4987 | checkGoogleCloudMlV1CancelJobRequest( |
| 4988 | obj as api.GoogleCloudMlV1CancelJobRequest); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4989 | |
| 4990 | var path = (req.url).path; |
| 4991 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4992 | core.int index; |
| 4993 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 4994 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 4995 | path.substring(pathOffset, pathOffset + 1), |
| 4996 | unittest.equals("/"), |
| 4997 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 4998 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 4999 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5000 | path.substring(pathOffset, pathOffset + 3), |
| 5001 | unittest.equals("v1/"), |
| 5002 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 5003 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5004 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5005 | |
| 5006 | var query = (req.url).query; |
| 5007 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5008 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5009 | void addQueryParam(core.String n, core.String v) => |
| 5010 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5011 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5012 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5013 | for (var part in query.split('&')) { |
| 5014 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5015 | addQueryParam( |
| 5016 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5017 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5018 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5019 | } |
| 5020 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5021 | unittest.expect( |
| 5022 | queryMap["fields"]!.first, |
| 5023 | unittest.equals(arg_$fields), |
| 5024 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5025 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5026 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5027 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5028 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5029 | var resp = convert.json.encode(buildGoogleProtobufEmpty()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5030 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5031 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5032 | final response = |
| 5033 | await res.cancel(arg_request, arg_name, $fields: arg_$fields); |
| 5034 | checkGoogleProtobufEmpty(response as api.GoogleProtobufEmpty); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5035 | }); |
| 5036 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5037 | unittest.test('method--create', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5038 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5039 | var res = api.CloudMachineLearningEngineApi(mock).projects.jobs; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 5040 | var arg_request = buildGoogleCloudMlV1Job(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5041 | var arg_parent = 'foo'; |
| 5042 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 5043 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 5044 | var obj = api.GoogleCloudMlV1Job.fromJson( |
| 5045 | json as core.Map<core.String, core.dynamic>); |
| 5046 | checkGoogleCloudMlV1Job(obj as api.GoogleCloudMlV1Job); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5047 | |
| 5048 | var path = (req.url).path; |
| 5049 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5050 | core.int index; |
| 5051 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5052 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5053 | path.substring(pathOffset, pathOffset + 1), |
| 5054 | unittest.equals("/"), |
| 5055 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5056 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5057 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5058 | path.substring(pathOffset, pathOffset + 3), |
| 5059 | unittest.equals("v1/"), |
| 5060 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 5061 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5062 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5063 | |
| 5064 | var query = (req.url).query; |
| 5065 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5066 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5067 | void addQueryParam(core.String n, core.String v) => |
| 5068 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5069 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5070 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5071 | for (var part in query.split('&')) { |
| 5072 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5073 | addQueryParam( |
| 5074 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5075 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5076 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5077 | } |
| 5078 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5079 | unittest.expect( |
| 5080 | queryMap["fields"]!.first, |
| 5081 | unittest.equals(arg_$fields), |
| 5082 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5083 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5084 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5085 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5086 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5087 | var resp = convert.json.encode(buildGoogleCloudMlV1Job()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5088 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5089 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5090 | final response = |
| 5091 | await res.create(arg_request, arg_parent, $fields: arg_$fields); |
| 5092 | checkGoogleCloudMlV1Job(response as api.GoogleCloudMlV1Job); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5093 | }); |
| 5094 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5095 | unittest.test('method--get', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5096 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5097 | var res = api.CloudMachineLearningEngineApi(mock).projects.jobs; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5098 | var arg_name = 'foo'; |
| 5099 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 5100 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5101 | var path = (req.url).path; |
| 5102 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5103 | core.int index; |
| 5104 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5105 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5106 | path.substring(pathOffset, pathOffset + 1), |
| 5107 | unittest.equals("/"), |
| 5108 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5109 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5110 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5111 | path.substring(pathOffset, pathOffset + 3), |
| 5112 | unittest.equals("v1/"), |
| 5113 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 5114 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5115 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5116 | |
| 5117 | var query = (req.url).query; |
| 5118 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5119 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5120 | void addQueryParam(core.String n, core.String v) => |
| 5121 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5122 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5123 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5124 | for (var part in query.split('&')) { |
| 5125 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5126 | addQueryParam( |
| 5127 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5128 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5129 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5130 | } |
| 5131 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5132 | unittest.expect( |
| 5133 | queryMap["fields"]!.first, |
| 5134 | unittest.equals(arg_$fields), |
| 5135 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5136 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5137 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5138 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5139 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5140 | var resp = convert.json.encode(buildGoogleCloudMlV1Job()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5141 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5142 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5143 | final response = await res.get(arg_name, $fields: arg_$fields); |
| 5144 | checkGoogleCloudMlV1Job(response as api.GoogleCloudMlV1Job); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5145 | }); |
| 5146 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5147 | unittest.test('method--getIamPolicy', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5148 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5149 | var res = api.CloudMachineLearningEngineApi(mock).projects.jobs; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5150 | var arg_resource = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5151 | var arg_options_requestedPolicyVersion = 42; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5152 | var arg_$fields = 'foo'; |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5153 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 5154 | var path = (req.url).path; |
| 5155 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5156 | core.int index; |
| 5157 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5158 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5159 | path.substring(pathOffset, pathOffset + 1), |
| 5160 | unittest.equals("/"), |
| 5161 | ); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5162 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5163 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5164 | path.substring(pathOffset, pathOffset + 3), |
| 5165 | unittest.equals("v1/"), |
| 5166 | ); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5167 | pathOffset += 3; |
| 5168 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5169 | |
| 5170 | var query = (req.url).query; |
| 5171 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5172 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5173 | void addQueryParam(core.String n, core.String v) => |
| 5174 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5175 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5176 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5177 | for (var part in query.split('&')) { |
| 5178 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5179 | addQueryParam( |
| 5180 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5181 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5182 | ); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5183 | } |
| 5184 | } |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5185 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5186 | core.int.parse(queryMap["options.requestedPolicyVersion"]!.first), |
| 5187 | unittest.equals(arg_options_requestedPolicyVersion), |
| 5188 | ); |
| 5189 | unittest.expect( |
| 5190 | queryMap["fields"]!.first, |
| 5191 | unittest.equals(arg_$fields), |
| 5192 | ); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5193 | |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5194 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5195 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5196 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5197 | var resp = convert.json.encode(buildGoogleIamV1Policy()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5198 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5199 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5200 | final response = await res.getIamPolicy(arg_resource, |
| 5201 | options_requestedPolicyVersion: arg_options_requestedPolicyVersion, |
| 5202 | $fields: arg_$fields); |
| 5203 | checkGoogleIamV1Policy(response as api.GoogleIamV1Policy); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5204 | }); |
| 5205 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5206 | unittest.test('method--list', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5207 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5208 | var res = api.CloudMachineLearningEngineApi(mock).projects.jobs; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5209 | var arg_parent = 'foo'; |
| 5210 | var arg_filter = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 5211 | var arg_pageSize = 42; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5212 | var arg_pageToken = 'foo'; |
| 5213 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 5214 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5215 | var path = (req.url).path; |
| 5216 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5217 | core.int index; |
| 5218 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5219 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5220 | path.substring(pathOffset, pathOffset + 1), |
| 5221 | unittest.equals("/"), |
| 5222 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5223 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5224 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5225 | path.substring(pathOffset, pathOffset + 3), |
| 5226 | unittest.equals("v1/"), |
| 5227 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 5228 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5229 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5230 | |
| 5231 | var query = (req.url).query; |
| 5232 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5233 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5234 | void addQueryParam(core.String n, core.String v) => |
| 5235 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5236 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5237 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5238 | for (var part in query.split('&')) { |
| 5239 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5240 | addQueryParam( |
| 5241 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5242 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5243 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5244 | } |
| 5245 | } |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 5246 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5247 | queryMap["filter"]!.first, |
| 5248 | unittest.equals(arg_filter), |
| 5249 | ); |
| 5250 | unittest.expect( |
| 5251 | core.int.parse(queryMap["pageSize"]!.first), |
| 5252 | unittest.equals(arg_pageSize), |
| 5253 | ); |
| 5254 | unittest.expect( |
| 5255 | queryMap["pageToken"]!.first, |
| 5256 | unittest.equals(arg_pageToken), |
| 5257 | ); |
| 5258 | unittest.expect( |
| 5259 | queryMap["fields"]!.first, |
| 5260 | unittest.equals(arg_$fields), |
| 5261 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5262 | |
| 5263 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5264 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5265 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5266 | var resp = convert.json.encode(buildGoogleCloudMlV1ListJobsResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5267 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5268 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5269 | final response = await res.list(arg_parent, |
| 5270 | filter: arg_filter, |
| 5271 | pageSize: arg_pageSize, |
| 5272 | pageToken: arg_pageToken, |
| 5273 | $fields: arg_$fields); |
| 5274 | checkGoogleCloudMlV1ListJobsResponse( |
| 5275 | response as api.GoogleCloudMlV1ListJobsResponse); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5276 | }); |
| 5277 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5278 | unittest.test('method--patch', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5279 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5280 | var res = api.CloudMachineLearningEngineApi(mock).projects.jobs; |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 5281 | var arg_request = buildGoogleCloudMlV1Job(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5282 | var arg_name = 'foo'; |
| 5283 | var arg_updateMask = 'foo'; |
| 5284 | var arg_$fields = 'foo'; |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 5285 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 5286 | var obj = api.GoogleCloudMlV1Job.fromJson( |
| 5287 | json as core.Map<core.String, core.dynamic>); |
| 5288 | checkGoogleCloudMlV1Job(obj as api.GoogleCloudMlV1Job); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 5289 | |
| 5290 | var path = (req.url).path; |
| 5291 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5292 | core.int index; |
| 5293 | core.String subPart; |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 5294 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5295 | path.substring(pathOffset, pathOffset + 1), |
| 5296 | unittest.equals("/"), |
| 5297 | ); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 5298 | pathOffset += 1; |
| 5299 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5300 | path.substring(pathOffset, pathOffset + 3), |
| 5301 | unittest.equals("v1/"), |
| 5302 | ); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 5303 | pathOffset += 3; |
| 5304 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5305 | |
| 5306 | var query = (req.url).query; |
| 5307 | var queryOffset = 0; |
| 5308 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5309 | void addQueryParam(core.String n, core.String v) => |
| 5310 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 5311 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5312 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5313 | for (var part in query.split('&')) { |
| 5314 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5315 | addQueryParam( |
| 5316 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5317 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5318 | ); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 5319 | } |
| 5320 | } |
| 5321 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5322 | queryMap["updateMask"]!.first, |
| 5323 | unittest.equals(arg_updateMask), |
| 5324 | ); |
| 5325 | unittest.expect( |
| 5326 | queryMap["fields"]!.first, |
| 5327 | unittest.equals(arg_$fields), |
| 5328 | ); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 5329 | |
| 5330 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5331 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 5332 | }; |
| 5333 | var resp = convert.json.encode(buildGoogleCloudMlV1Job()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5334 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 5335 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5336 | final response = await res.patch(arg_request, arg_name, |
| 5337 | updateMask: arg_updateMask, $fields: arg_$fields); |
| 5338 | checkGoogleCloudMlV1Job(response as api.GoogleCloudMlV1Job); |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 5339 | }); |
| 5340 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5341 | unittest.test('method--setIamPolicy', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5342 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5343 | var res = api.CloudMachineLearningEngineApi(mock).projects.jobs; |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5344 | var arg_request = buildGoogleIamV1SetIamPolicyRequest(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5345 | var arg_resource = 'foo'; |
| 5346 | var arg_$fields = 'foo'; |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5347 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 5348 | var obj = api.GoogleIamV1SetIamPolicyRequest.fromJson( |
| 5349 | json as core.Map<core.String, core.dynamic>); |
| 5350 | checkGoogleIamV1SetIamPolicyRequest( |
| 5351 | obj as api.GoogleIamV1SetIamPolicyRequest); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5352 | |
| 5353 | var path = (req.url).path; |
| 5354 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5355 | core.int index; |
| 5356 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5357 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5358 | path.substring(pathOffset, pathOffset + 1), |
| 5359 | unittest.equals("/"), |
| 5360 | ); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5361 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5362 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5363 | path.substring(pathOffset, pathOffset + 3), |
| 5364 | unittest.equals("v1/"), |
| 5365 | ); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5366 | pathOffset += 3; |
| 5367 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5368 | |
| 5369 | var query = (req.url).query; |
| 5370 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5371 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5372 | void addQueryParam(core.String n, core.String v) => |
| 5373 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5374 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5375 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5376 | for (var part in query.split('&')) { |
| 5377 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5378 | addQueryParam( |
| 5379 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5380 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5381 | ); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5382 | } |
| 5383 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5384 | unittest.expect( |
| 5385 | queryMap["fields"]!.first, |
| 5386 | unittest.equals(arg_$fields), |
| 5387 | ); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5388 | |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5389 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5390 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5391 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5392 | var resp = convert.json.encode(buildGoogleIamV1Policy()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5393 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5394 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5395 | final response = await res.setIamPolicy(arg_request, arg_resource, |
| 5396 | $fields: arg_$fields); |
| 5397 | checkGoogleIamV1Policy(response as api.GoogleIamV1Policy); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5398 | }); |
| 5399 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5400 | unittest.test('method--testIamPermissions', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5401 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5402 | var res = api.CloudMachineLearningEngineApi(mock).projects.jobs; |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5403 | var arg_request = buildGoogleIamV1TestIamPermissionsRequest(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5404 | var arg_resource = 'foo'; |
| 5405 | var arg_$fields = 'foo'; |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5406 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 5407 | var obj = api.GoogleIamV1TestIamPermissionsRequest.fromJson( |
| 5408 | json as core.Map<core.String, core.dynamic>); |
| 5409 | checkGoogleIamV1TestIamPermissionsRequest( |
| 5410 | obj as api.GoogleIamV1TestIamPermissionsRequest); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5411 | |
| 5412 | var path = (req.url).path; |
| 5413 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5414 | core.int index; |
| 5415 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5416 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5417 | path.substring(pathOffset, pathOffset + 1), |
| 5418 | unittest.equals("/"), |
| 5419 | ); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5420 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5421 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5422 | path.substring(pathOffset, pathOffset + 3), |
| 5423 | unittest.equals("v1/"), |
| 5424 | ); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5425 | pathOffset += 3; |
| 5426 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5427 | |
| 5428 | var query = (req.url).query; |
| 5429 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5430 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5431 | void addQueryParam(core.String n, core.String v) => |
| 5432 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5433 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5434 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5435 | for (var part in query.split('&')) { |
| 5436 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5437 | addQueryParam( |
| 5438 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5439 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5440 | ); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5441 | } |
| 5442 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5443 | unittest.expect( |
| 5444 | queryMap["fields"]!.first, |
| 5445 | unittest.equals(arg_$fields), |
| 5446 | ); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5447 | |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5448 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5449 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5450 | }; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 5451 | var resp = |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5452 | convert.json.encode(buildGoogleIamV1TestIamPermissionsResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5453 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5454 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5455 | final response = await res.testIamPermissions(arg_request, arg_resource, |
| 5456 | $fields: arg_$fields); |
| 5457 | checkGoogleIamV1TestIamPermissionsResponse( |
| 5458 | response as api.GoogleIamV1TestIamPermissionsResponse); |
Martin Kustermann | a28e671 | 2017-08-21 17:36:35 +0200 | [diff] [blame] | 5459 | }); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 5460 | }); |
| 5461 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 5462 | unittest.group('resource-ProjectsLocationsResource', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5463 | unittest.test('method--get', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5464 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5465 | var res = api.CloudMachineLearningEngineApi(mock).projects.locations; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5466 | var arg_name = 'foo'; |
| 5467 | var arg_$fields = 'foo'; |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5468 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 5469 | var path = (req.url).path; |
| 5470 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5471 | core.int index; |
| 5472 | core.String subPart; |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5473 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5474 | path.substring(pathOffset, pathOffset + 1), |
| 5475 | unittest.equals("/"), |
| 5476 | ); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5477 | pathOffset += 1; |
| 5478 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5479 | path.substring(pathOffset, pathOffset + 3), |
| 5480 | unittest.equals("v1/"), |
| 5481 | ); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5482 | pathOffset += 3; |
| 5483 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5484 | |
| 5485 | var query = (req.url).query; |
| 5486 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5487 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5488 | void addQueryParam(core.String n, core.String v) => |
| 5489 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5490 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5491 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5492 | for (var part in query.split('&')) { |
| 5493 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5494 | addQueryParam( |
| 5495 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5496 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5497 | ); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5498 | } |
| 5499 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5500 | unittest.expect( |
| 5501 | queryMap["fields"]!.first, |
| 5502 | unittest.equals(arg_$fields), |
| 5503 | ); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5504 | |
| 5505 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5506 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5507 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5508 | var resp = convert.json.encode(buildGoogleCloudMlV1Location()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5509 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5510 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5511 | final response = await res.get(arg_name, $fields: arg_$fields); |
| 5512 | checkGoogleCloudMlV1Location(response as api.GoogleCloudMlV1Location); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5513 | }); |
| 5514 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5515 | unittest.test('method--list', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5516 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5517 | var res = api.CloudMachineLearningEngineApi(mock).projects.locations; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5518 | var arg_parent = 'foo'; |
Martin Kustermann | 81eb88b | 2018-06-04 12:02:00 +0200 | [diff] [blame] | 5519 | var arg_pageSize = 42; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5520 | var arg_pageToken = 'foo'; |
| 5521 | var arg_$fields = 'foo'; |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5522 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 5523 | var path = (req.url).path; |
| 5524 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5525 | core.int index; |
| 5526 | core.String subPart; |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5527 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5528 | path.substring(pathOffset, pathOffset + 1), |
| 5529 | unittest.equals("/"), |
| 5530 | ); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5531 | pathOffset += 1; |
| 5532 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5533 | path.substring(pathOffset, pathOffset + 3), |
| 5534 | unittest.equals("v1/"), |
| 5535 | ); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5536 | pathOffset += 3; |
| 5537 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5538 | |
| 5539 | var query = (req.url).query; |
| 5540 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5541 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5542 | void addQueryParam(core.String n, core.String v) => |
| 5543 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5544 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5545 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5546 | for (var part in query.split('&')) { |
| 5547 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5548 | addQueryParam( |
| 5549 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5550 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5551 | ); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5552 | } |
| 5553 | } |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 5554 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5555 | core.int.parse(queryMap["pageSize"]!.first), |
| 5556 | unittest.equals(arg_pageSize), |
| 5557 | ); |
| 5558 | unittest.expect( |
| 5559 | queryMap["pageToken"]!.first, |
| 5560 | unittest.equals(arg_pageToken), |
| 5561 | ); |
| 5562 | unittest.expect( |
| 5563 | queryMap["fields"]!.first, |
| 5564 | unittest.equals(arg_$fields), |
| 5565 | ); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5566 | |
| 5567 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5568 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5569 | }; |
| 5570 | var resp = |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 5571 | convert.json.encode(buildGoogleCloudMlV1ListLocationsResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5572 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5573 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5574 | final response = await res.list(arg_parent, |
| 5575 | pageSize: arg_pageSize, |
| 5576 | pageToken: arg_pageToken, |
| 5577 | $fields: arg_$fields); |
| 5578 | checkGoogleCloudMlV1ListLocationsResponse( |
| 5579 | response as api.GoogleCloudMlV1ListLocationsResponse); |
Martin Kustermann | f9109a8 | 2018-01-08 15:24:20 +0100 | [diff] [blame] | 5580 | }); |
| 5581 | }); |
| 5582 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 5583 | unittest.group('resource-ProjectsLocationsOperationsResource', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5584 | unittest.test('method--cancel', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5585 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5586 | var res = |
| 5587 | api.CloudMachineLearningEngineApi(mock).projects.locations.operations; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5588 | var arg_name = 'foo'; |
| 5589 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5590 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 5591 | var path = (req.url).path; |
| 5592 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5593 | core.int index; |
| 5594 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5595 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5596 | path.substring(pathOffset, pathOffset + 1), |
| 5597 | unittest.equals("/"), |
| 5598 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5599 | pathOffset += 1; |
| 5600 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5601 | path.substring(pathOffset, pathOffset + 3), |
| 5602 | unittest.equals("v1/"), |
| 5603 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5604 | pathOffset += 3; |
| 5605 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5606 | |
| 5607 | var query = (req.url).query; |
| 5608 | var queryOffset = 0; |
| 5609 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5610 | void addQueryParam(core.String n, core.String v) => |
| 5611 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5612 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5613 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5614 | for (var part in query.split('&')) { |
| 5615 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5616 | addQueryParam( |
| 5617 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5618 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5619 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5620 | } |
| 5621 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5622 | unittest.expect( |
| 5623 | queryMap["fields"]!.first, |
| 5624 | unittest.equals(arg_$fields), |
| 5625 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5626 | |
| 5627 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5628 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5629 | }; |
| 5630 | var resp = convert.json.encode(buildGoogleProtobufEmpty()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5631 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5632 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5633 | final response = await res.cancel(arg_name, $fields: arg_$fields); |
| 5634 | checkGoogleProtobufEmpty(response as api.GoogleProtobufEmpty); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5635 | }); |
| 5636 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5637 | unittest.test('method--get', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5638 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5639 | var res = |
| 5640 | api.CloudMachineLearningEngineApi(mock).projects.locations.operations; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5641 | var arg_name = 'foo'; |
| 5642 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5643 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 5644 | var path = (req.url).path; |
| 5645 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5646 | core.int index; |
| 5647 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5648 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5649 | path.substring(pathOffset, pathOffset + 1), |
| 5650 | unittest.equals("/"), |
| 5651 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5652 | pathOffset += 1; |
| 5653 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5654 | path.substring(pathOffset, pathOffset + 3), |
| 5655 | unittest.equals("v1/"), |
| 5656 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5657 | pathOffset += 3; |
| 5658 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5659 | |
| 5660 | var query = (req.url).query; |
| 5661 | var queryOffset = 0; |
| 5662 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5663 | void addQueryParam(core.String n, core.String v) => |
| 5664 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5665 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5666 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5667 | for (var part in query.split('&')) { |
| 5668 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5669 | addQueryParam( |
| 5670 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5671 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5672 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5673 | } |
| 5674 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5675 | unittest.expect( |
| 5676 | queryMap["fields"]!.first, |
| 5677 | unittest.equals(arg_$fields), |
| 5678 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5679 | |
| 5680 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5681 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5682 | }; |
| 5683 | var resp = convert.json.encode(buildGoogleLongrunningOperation()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5684 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5685 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5686 | final response = await res.get(arg_name, $fields: arg_$fields); |
| 5687 | checkGoogleLongrunningOperation( |
| 5688 | response as api.GoogleLongrunningOperation); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5689 | }); |
| 5690 | }); |
| 5691 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 5692 | unittest.group('resource-ProjectsLocationsStudiesResource', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5693 | unittest.test('method--create', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5694 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5695 | var res = |
| 5696 | api.CloudMachineLearningEngineApi(mock).projects.locations.studies; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5697 | var arg_request = buildGoogleCloudMlV1Study(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5698 | var arg_parent = 'foo'; |
| 5699 | var arg_studyId = 'foo'; |
| 5700 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5701 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 5702 | var obj = api.GoogleCloudMlV1Study.fromJson( |
| 5703 | json as core.Map<core.String, core.dynamic>); |
| 5704 | checkGoogleCloudMlV1Study(obj as api.GoogleCloudMlV1Study); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5705 | |
| 5706 | var path = (req.url).path; |
| 5707 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5708 | core.int index; |
| 5709 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5710 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5711 | path.substring(pathOffset, pathOffset + 1), |
| 5712 | unittest.equals("/"), |
| 5713 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5714 | pathOffset += 1; |
| 5715 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5716 | path.substring(pathOffset, pathOffset + 3), |
| 5717 | unittest.equals("v1/"), |
| 5718 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5719 | pathOffset += 3; |
| 5720 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5721 | |
| 5722 | var query = (req.url).query; |
| 5723 | var queryOffset = 0; |
| 5724 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5725 | void addQueryParam(core.String n, core.String v) => |
| 5726 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5727 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5728 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5729 | for (var part in query.split('&')) { |
| 5730 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5731 | addQueryParam( |
| 5732 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5733 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5734 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5735 | } |
| 5736 | } |
| 5737 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5738 | queryMap["studyId"]!.first, |
| 5739 | unittest.equals(arg_studyId), |
| 5740 | ); |
| 5741 | unittest.expect( |
| 5742 | queryMap["fields"]!.first, |
| 5743 | unittest.equals(arg_$fields), |
| 5744 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5745 | |
| 5746 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5747 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5748 | }; |
| 5749 | var resp = convert.json.encode(buildGoogleCloudMlV1Study()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5750 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5751 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5752 | final response = await res.create(arg_request, arg_parent, |
| 5753 | studyId: arg_studyId, $fields: arg_$fields); |
| 5754 | checkGoogleCloudMlV1Study(response as api.GoogleCloudMlV1Study); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5755 | }); |
| 5756 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5757 | unittest.test('method--delete', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5758 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5759 | var res = |
| 5760 | api.CloudMachineLearningEngineApi(mock).projects.locations.studies; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5761 | var arg_name = 'foo'; |
| 5762 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5763 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 5764 | var path = (req.url).path; |
| 5765 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5766 | core.int index; |
| 5767 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5768 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5769 | path.substring(pathOffset, pathOffset + 1), |
| 5770 | unittest.equals("/"), |
| 5771 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5772 | pathOffset += 1; |
| 5773 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5774 | path.substring(pathOffset, pathOffset + 3), |
| 5775 | unittest.equals("v1/"), |
| 5776 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5777 | pathOffset += 3; |
| 5778 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5779 | |
| 5780 | var query = (req.url).query; |
| 5781 | var queryOffset = 0; |
| 5782 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5783 | void addQueryParam(core.String n, core.String v) => |
| 5784 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5785 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5786 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5787 | for (var part in query.split('&')) { |
| 5788 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5789 | addQueryParam( |
| 5790 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5791 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5792 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5793 | } |
| 5794 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5795 | unittest.expect( |
| 5796 | queryMap["fields"]!.first, |
| 5797 | unittest.equals(arg_$fields), |
| 5798 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5799 | |
| 5800 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5801 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5802 | }; |
| 5803 | var resp = convert.json.encode(buildGoogleProtobufEmpty()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5804 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5805 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5806 | final response = await res.delete(arg_name, $fields: arg_$fields); |
| 5807 | checkGoogleProtobufEmpty(response as api.GoogleProtobufEmpty); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5808 | }); |
| 5809 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5810 | unittest.test('method--get', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5811 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5812 | var res = |
| 5813 | api.CloudMachineLearningEngineApi(mock).projects.locations.studies; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5814 | var arg_name = 'foo'; |
| 5815 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5816 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 5817 | var path = (req.url).path; |
| 5818 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5819 | core.int index; |
| 5820 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5821 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5822 | path.substring(pathOffset, pathOffset + 1), |
| 5823 | unittest.equals("/"), |
| 5824 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5825 | pathOffset += 1; |
| 5826 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5827 | path.substring(pathOffset, pathOffset + 3), |
| 5828 | unittest.equals("v1/"), |
| 5829 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5830 | pathOffset += 3; |
| 5831 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5832 | |
| 5833 | var query = (req.url).query; |
| 5834 | var queryOffset = 0; |
| 5835 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5836 | void addQueryParam(core.String n, core.String v) => |
| 5837 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5838 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5839 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5840 | for (var part in query.split('&')) { |
| 5841 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5842 | addQueryParam( |
| 5843 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5844 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5845 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5846 | } |
| 5847 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5848 | unittest.expect( |
| 5849 | queryMap["fields"]!.first, |
| 5850 | unittest.equals(arg_$fields), |
| 5851 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5852 | |
| 5853 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5854 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5855 | }; |
| 5856 | var resp = convert.json.encode(buildGoogleCloudMlV1Study()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5857 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5858 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5859 | final response = await res.get(arg_name, $fields: arg_$fields); |
| 5860 | checkGoogleCloudMlV1Study(response as api.GoogleCloudMlV1Study); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5861 | }); |
| 5862 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5863 | unittest.test('method--list', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5864 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5865 | var res = |
| 5866 | api.CloudMachineLearningEngineApi(mock).projects.locations.studies; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5867 | var arg_parent = 'foo'; |
| 5868 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5869 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 5870 | var path = (req.url).path; |
| 5871 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5872 | core.int index; |
| 5873 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5874 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5875 | path.substring(pathOffset, pathOffset + 1), |
| 5876 | unittest.equals("/"), |
| 5877 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5878 | pathOffset += 1; |
| 5879 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5880 | path.substring(pathOffset, pathOffset + 3), |
| 5881 | unittest.equals("v1/"), |
| 5882 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5883 | pathOffset += 3; |
| 5884 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5885 | |
| 5886 | var query = (req.url).query; |
| 5887 | var queryOffset = 0; |
| 5888 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5889 | void addQueryParam(core.String n, core.String v) => |
| 5890 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5891 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5892 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5893 | for (var part in query.split('&')) { |
| 5894 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5895 | addQueryParam( |
| 5896 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5897 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5898 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5899 | } |
| 5900 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5901 | unittest.expect( |
| 5902 | queryMap["fields"]!.first, |
| 5903 | unittest.equals(arg_$fields), |
| 5904 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5905 | |
| 5906 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5907 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5908 | }; |
| 5909 | var resp = |
| 5910 | convert.json.encode(buildGoogleCloudMlV1ListStudiesResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5911 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5912 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5913 | final response = await res.list(arg_parent, $fields: arg_$fields); |
| 5914 | checkGoogleCloudMlV1ListStudiesResponse( |
| 5915 | response as api.GoogleCloudMlV1ListStudiesResponse); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5916 | }); |
| 5917 | }); |
| 5918 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 5919 | unittest.group('resource-ProjectsLocationsStudiesTrialsResource', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5920 | unittest.test('method--addMeasurement', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5921 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5922 | var res = api.CloudMachineLearningEngineApi(mock) |
| 5923 | .projects |
| 5924 | .locations |
| 5925 | .studies |
| 5926 | .trials; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5927 | var arg_request = buildGoogleCloudMlV1AddTrialMeasurementRequest(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5928 | var arg_name = 'foo'; |
| 5929 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5930 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 5931 | var obj = api.GoogleCloudMlV1AddTrialMeasurementRequest.fromJson( |
| 5932 | json as core.Map<core.String, core.dynamic>); |
| 5933 | checkGoogleCloudMlV1AddTrialMeasurementRequest( |
| 5934 | obj as api.GoogleCloudMlV1AddTrialMeasurementRequest); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5935 | |
| 5936 | var path = (req.url).path; |
| 5937 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5938 | core.int index; |
| 5939 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5940 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5941 | path.substring(pathOffset, pathOffset + 1), |
| 5942 | unittest.equals("/"), |
| 5943 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5944 | pathOffset += 1; |
| 5945 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5946 | path.substring(pathOffset, pathOffset + 3), |
| 5947 | unittest.equals("v1/"), |
| 5948 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5949 | pathOffset += 3; |
| 5950 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 5951 | |
| 5952 | var query = (req.url).query; |
| 5953 | var queryOffset = 0; |
| 5954 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 5955 | void addQueryParam(core.String n, core.String v) => |
| 5956 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5957 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5958 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5959 | for (var part in query.split('&')) { |
| 5960 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5961 | addQueryParam( |
| 5962 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 5963 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 5964 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5965 | } |
| 5966 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 5967 | unittest.expect( |
| 5968 | queryMap["fields"]!.first, |
| 5969 | unittest.equals(arg_$fields), |
| 5970 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5971 | |
| 5972 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5973 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5974 | }; |
| 5975 | var resp = convert.json.encode(buildGoogleCloudMlV1Trial()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5976 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5977 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5978 | final response = |
| 5979 | await res.addMeasurement(arg_request, arg_name, $fields: arg_$fields); |
| 5980 | checkGoogleCloudMlV1Trial(response as api.GoogleCloudMlV1Trial); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5981 | }); |
| 5982 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 5983 | unittest.test('method--checkEarlyStoppingState', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5984 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 5985 | var res = api.CloudMachineLearningEngineApi(mock) |
| 5986 | .projects |
| 5987 | .locations |
| 5988 | .studies |
| 5989 | .trials; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5990 | var arg_request = |
| 5991 | buildGoogleCloudMlV1CheckTrialEarlyStoppingStateRequest(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5992 | var arg_name = 'foo'; |
| 5993 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 5994 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 5995 | var obj = |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 5996 | api.GoogleCloudMlV1CheckTrialEarlyStoppingStateRequest.fromJson( |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 5997 | json as core.Map<core.String, core.dynamic>); |
| 5998 | checkGoogleCloudMlV1CheckTrialEarlyStoppingStateRequest( |
| 5999 | obj as api.GoogleCloudMlV1CheckTrialEarlyStoppingStateRequest); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6000 | |
| 6001 | var path = (req.url).path; |
| 6002 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6003 | core.int index; |
| 6004 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6005 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6006 | path.substring(pathOffset, pathOffset + 1), |
| 6007 | unittest.equals("/"), |
| 6008 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6009 | pathOffset += 1; |
| 6010 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6011 | path.substring(pathOffset, pathOffset + 3), |
| 6012 | unittest.equals("v1/"), |
| 6013 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6014 | pathOffset += 3; |
| 6015 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6016 | |
| 6017 | var query = (req.url).query; |
| 6018 | var queryOffset = 0; |
| 6019 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6020 | void addQueryParam(core.String n, core.String v) => |
| 6021 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6022 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6023 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6024 | for (var part in query.split('&')) { |
| 6025 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6026 | addQueryParam( |
| 6027 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6028 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6029 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6030 | } |
| 6031 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6032 | unittest.expect( |
| 6033 | queryMap["fields"]!.first, |
| 6034 | unittest.equals(arg_$fields), |
| 6035 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6036 | |
| 6037 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6038 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6039 | }; |
| 6040 | var resp = convert.json.encode(buildGoogleLongrunningOperation()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6041 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6042 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6043 | final response = await res.checkEarlyStoppingState(arg_request, arg_name, |
| 6044 | $fields: arg_$fields); |
| 6045 | checkGoogleLongrunningOperation( |
| 6046 | response as api.GoogleLongrunningOperation); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6047 | }); |
| 6048 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6049 | unittest.test('method--complete', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6050 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 6051 | var res = api.CloudMachineLearningEngineApi(mock) |
| 6052 | .projects |
| 6053 | .locations |
| 6054 | .studies |
| 6055 | .trials; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6056 | var arg_request = buildGoogleCloudMlV1CompleteTrialRequest(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6057 | var arg_name = 'foo'; |
| 6058 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6059 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 6060 | var obj = api.GoogleCloudMlV1CompleteTrialRequest.fromJson( |
| 6061 | json as core.Map<core.String, core.dynamic>); |
| 6062 | checkGoogleCloudMlV1CompleteTrialRequest( |
| 6063 | obj as api.GoogleCloudMlV1CompleteTrialRequest); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6064 | |
| 6065 | var path = (req.url).path; |
| 6066 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6067 | core.int index; |
| 6068 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6069 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6070 | path.substring(pathOffset, pathOffset + 1), |
| 6071 | unittest.equals("/"), |
| 6072 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6073 | pathOffset += 1; |
| 6074 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6075 | path.substring(pathOffset, pathOffset + 3), |
| 6076 | unittest.equals("v1/"), |
| 6077 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6078 | pathOffset += 3; |
| 6079 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6080 | |
| 6081 | var query = (req.url).query; |
| 6082 | var queryOffset = 0; |
| 6083 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6084 | void addQueryParam(core.String n, core.String v) => |
| 6085 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6086 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6087 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6088 | for (var part in query.split('&')) { |
| 6089 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6090 | addQueryParam( |
| 6091 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6092 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6093 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6094 | } |
| 6095 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6096 | unittest.expect( |
| 6097 | queryMap["fields"]!.first, |
| 6098 | unittest.equals(arg_$fields), |
| 6099 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6100 | |
| 6101 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6102 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6103 | }; |
| 6104 | var resp = convert.json.encode(buildGoogleCloudMlV1Trial()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6105 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6106 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6107 | final response = |
| 6108 | await res.complete(arg_request, arg_name, $fields: arg_$fields); |
| 6109 | checkGoogleCloudMlV1Trial(response as api.GoogleCloudMlV1Trial); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6110 | }); |
| 6111 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6112 | unittest.test('method--create', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6113 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 6114 | var res = api.CloudMachineLearningEngineApi(mock) |
| 6115 | .projects |
| 6116 | .locations |
| 6117 | .studies |
| 6118 | .trials; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6119 | var arg_request = buildGoogleCloudMlV1Trial(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6120 | var arg_parent = 'foo'; |
| 6121 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6122 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 6123 | var obj = api.GoogleCloudMlV1Trial.fromJson( |
| 6124 | json as core.Map<core.String, core.dynamic>); |
| 6125 | checkGoogleCloudMlV1Trial(obj as api.GoogleCloudMlV1Trial); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6126 | |
| 6127 | var path = (req.url).path; |
| 6128 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6129 | core.int index; |
| 6130 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6131 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6132 | path.substring(pathOffset, pathOffset + 1), |
| 6133 | unittest.equals("/"), |
| 6134 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6135 | pathOffset += 1; |
| 6136 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6137 | path.substring(pathOffset, pathOffset + 3), |
| 6138 | unittest.equals("v1/"), |
| 6139 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6140 | pathOffset += 3; |
| 6141 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6142 | |
| 6143 | var query = (req.url).query; |
| 6144 | var queryOffset = 0; |
| 6145 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6146 | void addQueryParam(core.String n, core.String v) => |
| 6147 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6148 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6149 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6150 | for (var part in query.split('&')) { |
| 6151 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6152 | addQueryParam( |
| 6153 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6154 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6155 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6156 | } |
| 6157 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6158 | unittest.expect( |
| 6159 | queryMap["fields"]!.first, |
| 6160 | unittest.equals(arg_$fields), |
| 6161 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6162 | |
| 6163 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6164 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6165 | }; |
| 6166 | var resp = convert.json.encode(buildGoogleCloudMlV1Trial()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6167 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6168 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6169 | final response = |
| 6170 | await res.create(arg_request, arg_parent, $fields: arg_$fields); |
| 6171 | checkGoogleCloudMlV1Trial(response as api.GoogleCloudMlV1Trial); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6172 | }); |
| 6173 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6174 | unittest.test('method--delete', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6175 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 6176 | var res = api.CloudMachineLearningEngineApi(mock) |
| 6177 | .projects |
| 6178 | .locations |
| 6179 | .studies |
| 6180 | .trials; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6181 | var arg_name = 'foo'; |
| 6182 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6183 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 6184 | var path = (req.url).path; |
| 6185 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6186 | core.int index; |
| 6187 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6188 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6189 | path.substring(pathOffset, pathOffset + 1), |
| 6190 | unittest.equals("/"), |
| 6191 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6192 | pathOffset += 1; |
| 6193 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6194 | path.substring(pathOffset, pathOffset + 3), |
| 6195 | unittest.equals("v1/"), |
| 6196 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6197 | pathOffset += 3; |
| 6198 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6199 | |
| 6200 | var query = (req.url).query; |
| 6201 | var queryOffset = 0; |
| 6202 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6203 | void addQueryParam(core.String n, core.String v) => |
| 6204 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6205 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6206 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6207 | for (var part in query.split('&')) { |
| 6208 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6209 | addQueryParam( |
| 6210 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6211 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6212 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6213 | } |
| 6214 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6215 | unittest.expect( |
| 6216 | queryMap["fields"]!.first, |
| 6217 | unittest.equals(arg_$fields), |
| 6218 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6219 | |
| 6220 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6221 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6222 | }; |
| 6223 | var resp = convert.json.encode(buildGoogleProtobufEmpty()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6224 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6225 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6226 | final response = await res.delete(arg_name, $fields: arg_$fields); |
| 6227 | checkGoogleProtobufEmpty(response as api.GoogleProtobufEmpty); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6228 | }); |
| 6229 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6230 | unittest.test('method--get', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6231 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 6232 | var res = api.CloudMachineLearningEngineApi(mock) |
| 6233 | .projects |
| 6234 | .locations |
| 6235 | .studies |
| 6236 | .trials; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6237 | var arg_name = 'foo'; |
| 6238 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6239 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 6240 | var path = (req.url).path; |
| 6241 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6242 | core.int index; |
| 6243 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6244 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6245 | path.substring(pathOffset, pathOffset + 1), |
| 6246 | unittest.equals("/"), |
| 6247 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6248 | pathOffset += 1; |
| 6249 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6250 | path.substring(pathOffset, pathOffset + 3), |
| 6251 | unittest.equals("v1/"), |
| 6252 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6253 | pathOffset += 3; |
| 6254 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6255 | |
| 6256 | var query = (req.url).query; |
| 6257 | var queryOffset = 0; |
| 6258 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6259 | void addQueryParam(core.String n, core.String v) => |
| 6260 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6261 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6262 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6263 | for (var part in query.split('&')) { |
| 6264 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6265 | addQueryParam( |
| 6266 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6267 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6268 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6269 | } |
| 6270 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6271 | unittest.expect( |
| 6272 | queryMap["fields"]!.first, |
| 6273 | unittest.equals(arg_$fields), |
| 6274 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6275 | |
| 6276 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6277 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6278 | }; |
| 6279 | var resp = convert.json.encode(buildGoogleCloudMlV1Trial()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6280 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6281 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6282 | final response = await res.get(arg_name, $fields: arg_$fields); |
| 6283 | checkGoogleCloudMlV1Trial(response as api.GoogleCloudMlV1Trial); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6284 | }); |
| 6285 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6286 | unittest.test('method--list', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6287 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 6288 | var res = api.CloudMachineLearningEngineApi(mock) |
| 6289 | .projects |
| 6290 | .locations |
| 6291 | .studies |
| 6292 | .trials; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6293 | var arg_parent = 'foo'; |
| 6294 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6295 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 6296 | var path = (req.url).path; |
| 6297 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6298 | core.int index; |
| 6299 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6300 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6301 | path.substring(pathOffset, pathOffset + 1), |
| 6302 | unittest.equals("/"), |
| 6303 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6304 | pathOffset += 1; |
| 6305 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6306 | path.substring(pathOffset, pathOffset + 3), |
| 6307 | unittest.equals("v1/"), |
| 6308 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6309 | pathOffset += 3; |
| 6310 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6311 | |
| 6312 | var query = (req.url).query; |
| 6313 | var queryOffset = 0; |
| 6314 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6315 | void addQueryParam(core.String n, core.String v) => |
| 6316 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6317 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6318 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6319 | for (var part in query.split('&')) { |
| 6320 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6321 | addQueryParam( |
| 6322 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6323 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6324 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6325 | } |
| 6326 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6327 | unittest.expect( |
| 6328 | queryMap["fields"]!.first, |
| 6329 | unittest.equals(arg_$fields), |
| 6330 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6331 | |
| 6332 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6333 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6334 | }; |
| 6335 | var resp = |
| 6336 | convert.json.encode(buildGoogleCloudMlV1ListTrialsResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6337 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6338 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6339 | final response = await res.list(arg_parent, $fields: arg_$fields); |
| 6340 | checkGoogleCloudMlV1ListTrialsResponse( |
| 6341 | response as api.GoogleCloudMlV1ListTrialsResponse); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6342 | }); |
| 6343 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6344 | unittest.test('method--listOptimalTrials', () async { |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 6345 | var mock = HttpServerMock(); |
| 6346 | var res = api.CloudMachineLearningEngineApi(mock) |
| 6347 | .projects |
| 6348 | .locations |
| 6349 | .studies |
| 6350 | .trials; |
| 6351 | var arg_request = buildGoogleCloudMlV1ListOptimalTrialsRequest(); |
| 6352 | var arg_parent = 'foo'; |
| 6353 | var arg_$fields = 'foo'; |
| 6354 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 6355 | var obj = api.GoogleCloudMlV1ListOptimalTrialsRequest.fromJson( |
| 6356 | json as core.Map<core.String, core.dynamic>); |
| 6357 | checkGoogleCloudMlV1ListOptimalTrialsRequest( |
| 6358 | obj as api.GoogleCloudMlV1ListOptimalTrialsRequest); |
| 6359 | |
| 6360 | var path = (req.url).path; |
| 6361 | var pathOffset = 0; |
| 6362 | core.int index; |
| 6363 | core.String subPart; |
| 6364 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6365 | path.substring(pathOffset, pathOffset + 1), |
| 6366 | unittest.equals("/"), |
| 6367 | ); |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 6368 | pathOffset += 1; |
| 6369 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6370 | path.substring(pathOffset, pathOffset + 3), |
| 6371 | unittest.equals("v1/"), |
| 6372 | ); |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 6373 | pathOffset += 3; |
| 6374 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6375 | |
| 6376 | var query = (req.url).query; |
| 6377 | var queryOffset = 0; |
| 6378 | var queryMap = <core.String, core.List<core.String>>{}; |
| 6379 | void addQueryParam(core.String n, core.String v) => |
| 6380 | queryMap.putIfAbsent(n, () => []).add(v); |
| 6381 | |
| 6382 | if (query.isNotEmpty) { |
| 6383 | for (var part in query.split('&')) { |
| 6384 | var keyValue = part.split('='); |
| 6385 | addQueryParam( |
| 6386 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6387 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6388 | ); |
| 6389 | } |
| 6390 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6391 | unittest.expect( |
| 6392 | queryMap["fields"]!.first, |
| 6393 | unittest.equals(arg_$fields), |
| 6394 | ); |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 6395 | |
| 6396 | var h = { |
| 6397 | 'content-type': 'application/json; charset=utf-8', |
| 6398 | }; |
| 6399 | var resp = convert.json |
| 6400 | .encode(buildGoogleCloudMlV1ListOptimalTrialsResponse()); |
| 6401 | return async.Future.value(stringResponse(200, h, resp)); |
| 6402 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6403 | final response = await res.listOptimalTrials(arg_request, arg_parent, |
| 6404 | $fields: arg_$fields); |
| 6405 | checkGoogleCloudMlV1ListOptimalTrialsResponse( |
| 6406 | response as api.GoogleCloudMlV1ListOptimalTrialsResponse); |
Kevin Moore | 0946dce | 2021-02-04 09:58:04 -0800 | [diff] [blame] | 6407 | }); |
| 6408 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6409 | unittest.test('method--stop', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6410 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 6411 | var res = api.CloudMachineLearningEngineApi(mock) |
| 6412 | .projects |
| 6413 | .locations |
| 6414 | .studies |
| 6415 | .trials; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6416 | var arg_request = buildGoogleCloudMlV1StopTrialRequest(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6417 | var arg_name = 'foo'; |
| 6418 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6419 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 6420 | var obj = api.GoogleCloudMlV1StopTrialRequest.fromJson( |
| 6421 | json as core.Map<core.String, core.dynamic>); |
| 6422 | checkGoogleCloudMlV1StopTrialRequest( |
| 6423 | obj as api.GoogleCloudMlV1StopTrialRequest); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6424 | |
| 6425 | var path = (req.url).path; |
| 6426 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6427 | core.int index; |
| 6428 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6429 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6430 | path.substring(pathOffset, pathOffset + 1), |
| 6431 | unittest.equals("/"), |
| 6432 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6433 | pathOffset += 1; |
| 6434 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6435 | path.substring(pathOffset, pathOffset + 3), |
| 6436 | unittest.equals("v1/"), |
| 6437 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6438 | pathOffset += 3; |
| 6439 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6440 | |
| 6441 | var query = (req.url).query; |
| 6442 | var queryOffset = 0; |
| 6443 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6444 | void addQueryParam(core.String n, core.String v) => |
| 6445 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6446 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6447 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6448 | for (var part in query.split('&')) { |
| 6449 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6450 | addQueryParam( |
| 6451 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6452 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6453 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6454 | } |
| 6455 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6456 | unittest.expect( |
| 6457 | queryMap["fields"]!.first, |
| 6458 | unittest.equals(arg_$fields), |
| 6459 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6460 | |
| 6461 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6462 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6463 | }; |
| 6464 | var resp = convert.json.encode(buildGoogleCloudMlV1Trial()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6465 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6466 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6467 | final response = |
| 6468 | await res.stop(arg_request, arg_name, $fields: arg_$fields); |
| 6469 | checkGoogleCloudMlV1Trial(response as api.GoogleCloudMlV1Trial); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6470 | }); |
| 6471 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6472 | unittest.test('method--suggest', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6473 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 6474 | var res = api.CloudMachineLearningEngineApi(mock) |
| 6475 | .projects |
| 6476 | .locations |
| 6477 | .studies |
| 6478 | .trials; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6479 | var arg_request = buildGoogleCloudMlV1SuggestTrialsRequest(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6480 | var arg_parent = 'foo'; |
| 6481 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6482 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 6483 | var obj = api.GoogleCloudMlV1SuggestTrialsRequest.fromJson( |
| 6484 | json as core.Map<core.String, core.dynamic>); |
| 6485 | checkGoogleCloudMlV1SuggestTrialsRequest( |
| 6486 | obj as api.GoogleCloudMlV1SuggestTrialsRequest); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6487 | |
| 6488 | var path = (req.url).path; |
| 6489 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6490 | core.int index; |
| 6491 | core.String subPart; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6492 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6493 | path.substring(pathOffset, pathOffset + 1), |
| 6494 | unittest.equals("/"), |
| 6495 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6496 | pathOffset += 1; |
| 6497 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6498 | path.substring(pathOffset, pathOffset + 3), |
| 6499 | unittest.equals("v1/"), |
| 6500 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6501 | pathOffset += 3; |
| 6502 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6503 | |
| 6504 | var query = (req.url).query; |
| 6505 | var queryOffset = 0; |
| 6506 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6507 | void addQueryParam(core.String n, core.String v) => |
| 6508 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6509 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6510 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6511 | for (var part in query.split('&')) { |
| 6512 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6513 | addQueryParam( |
| 6514 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6515 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6516 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6517 | } |
| 6518 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6519 | unittest.expect( |
| 6520 | queryMap["fields"]!.first, |
| 6521 | unittest.equals(arg_$fields), |
| 6522 | ); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6523 | |
| 6524 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6525 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6526 | }; |
| 6527 | var resp = convert.json.encode(buildGoogleLongrunningOperation()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6528 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6529 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6530 | final response = |
| 6531 | await res.suggest(arg_request, arg_parent, $fields: arg_$fields); |
| 6532 | checkGoogleLongrunningOperation( |
| 6533 | response as api.GoogleLongrunningOperation); |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6534 | }); |
| 6535 | }); |
| 6536 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 6537 | unittest.group('resource-ProjectsModelsResource', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6538 | unittest.test('method--create', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6539 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 6540 | var res = api.CloudMachineLearningEngineApi(mock).projects.models; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 6541 | var arg_request = buildGoogleCloudMlV1Model(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6542 | var arg_parent = 'foo'; |
| 6543 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 6544 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 6545 | var obj = api.GoogleCloudMlV1Model.fromJson( |
| 6546 | json as core.Map<core.String, core.dynamic>); |
| 6547 | checkGoogleCloudMlV1Model(obj as api.GoogleCloudMlV1Model); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6548 | |
| 6549 | var path = (req.url).path; |
| 6550 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6551 | core.int index; |
| 6552 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6553 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6554 | path.substring(pathOffset, pathOffset + 1), |
| 6555 | unittest.equals("/"), |
| 6556 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6557 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6558 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6559 | path.substring(pathOffset, pathOffset + 3), |
| 6560 | unittest.equals("v1/"), |
| 6561 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 6562 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6563 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6564 | |
| 6565 | var query = (req.url).query; |
| 6566 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 6567 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6568 | void addQueryParam(core.String n, core.String v) => |
| 6569 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6570 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6571 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6572 | for (var part in query.split('&')) { |
| 6573 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6574 | addQueryParam( |
| 6575 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6576 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6577 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6578 | } |
| 6579 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6580 | unittest.expect( |
| 6581 | queryMap["fields"]!.first, |
| 6582 | unittest.equals(arg_$fields), |
| 6583 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6584 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6585 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6586 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6587 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 6588 | var resp = convert.json.encode(buildGoogleCloudMlV1Model()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6589 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6590 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6591 | final response = |
| 6592 | await res.create(arg_request, arg_parent, $fields: arg_$fields); |
| 6593 | checkGoogleCloudMlV1Model(response as api.GoogleCloudMlV1Model); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6594 | }); |
| 6595 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6596 | unittest.test('method--delete', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6597 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 6598 | var res = api.CloudMachineLearningEngineApi(mock).projects.models; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6599 | var arg_name = 'foo'; |
| 6600 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 6601 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6602 | var path = (req.url).path; |
| 6603 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6604 | core.int index; |
| 6605 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6606 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6607 | path.substring(pathOffset, pathOffset + 1), |
| 6608 | unittest.equals("/"), |
| 6609 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6610 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6611 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6612 | path.substring(pathOffset, pathOffset + 3), |
| 6613 | unittest.equals("v1/"), |
| 6614 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 6615 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6616 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6617 | |
| 6618 | var query = (req.url).query; |
| 6619 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 6620 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6621 | void addQueryParam(core.String n, core.String v) => |
| 6622 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6623 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6624 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6625 | for (var part in query.split('&')) { |
| 6626 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6627 | addQueryParam( |
| 6628 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6629 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6630 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6631 | } |
| 6632 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6633 | unittest.expect( |
| 6634 | queryMap["fields"]!.first, |
| 6635 | unittest.equals(arg_$fields), |
| 6636 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6637 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6638 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6639 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6640 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 6641 | var resp = convert.json.encode(buildGoogleLongrunningOperation()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6642 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6643 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6644 | final response = await res.delete(arg_name, $fields: arg_$fields); |
| 6645 | checkGoogleLongrunningOperation( |
| 6646 | response as api.GoogleLongrunningOperation); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6647 | }); |
| 6648 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6649 | unittest.test('method--get', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6650 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 6651 | var res = api.CloudMachineLearningEngineApi(mock).projects.models; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6652 | var arg_name = 'foo'; |
| 6653 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 6654 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6655 | var path = (req.url).path; |
| 6656 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6657 | core.int index; |
| 6658 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6659 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6660 | path.substring(pathOffset, pathOffset + 1), |
| 6661 | unittest.equals("/"), |
| 6662 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6663 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6664 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6665 | path.substring(pathOffset, pathOffset + 3), |
| 6666 | unittest.equals("v1/"), |
| 6667 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 6668 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6669 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6670 | |
| 6671 | var query = (req.url).query; |
| 6672 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 6673 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6674 | void addQueryParam(core.String n, core.String v) => |
| 6675 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6676 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6677 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6678 | for (var part in query.split('&')) { |
| 6679 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6680 | addQueryParam( |
| 6681 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6682 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6683 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6684 | } |
| 6685 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6686 | unittest.expect( |
| 6687 | queryMap["fields"]!.first, |
| 6688 | unittest.equals(arg_$fields), |
| 6689 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6690 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6691 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6692 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6693 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 6694 | var resp = convert.json.encode(buildGoogleCloudMlV1Model()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6695 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6696 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6697 | final response = await res.get(arg_name, $fields: arg_$fields); |
| 6698 | checkGoogleCloudMlV1Model(response as api.GoogleCloudMlV1Model); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6699 | }); |
| 6700 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6701 | unittest.test('method--getIamPolicy', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6702 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 6703 | var res = api.CloudMachineLearningEngineApi(mock).projects.models; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6704 | var arg_resource = 'foo'; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6705 | var arg_options_requestedPolicyVersion = 42; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6706 | var arg_$fields = 'foo'; |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6707 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 6708 | var path = (req.url).path; |
| 6709 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6710 | core.int index; |
| 6711 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6712 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6713 | path.substring(pathOffset, pathOffset + 1), |
| 6714 | unittest.equals("/"), |
| 6715 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6716 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6717 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6718 | path.substring(pathOffset, pathOffset + 3), |
| 6719 | unittest.equals("v1/"), |
| 6720 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6721 | pathOffset += 3; |
| 6722 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6723 | |
| 6724 | var query = (req.url).query; |
| 6725 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 6726 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6727 | void addQueryParam(core.String n, core.String v) => |
| 6728 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6729 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6730 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6731 | for (var part in query.split('&')) { |
| 6732 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6733 | addQueryParam( |
| 6734 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6735 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6736 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6737 | } |
| 6738 | } |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 6739 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6740 | core.int.parse(queryMap["options.requestedPolicyVersion"]!.first), |
| 6741 | unittest.equals(arg_options_requestedPolicyVersion), |
| 6742 | ); |
| 6743 | unittest.expect( |
| 6744 | queryMap["fields"]!.first, |
| 6745 | unittest.equals(arg_$fields), |
| 6746 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6747 | |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6748 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6749 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6750 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 6751 | var resp = convert.json.encode(buildGoogleIamV1Policy()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6752 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6753 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6754 | final response = await res.getIamPolicy(arg_resource, |
| 6755 | options_requestedPolicyVersion: arg_options_requestedPolicyVersion, |
| 6756 | $fields: arg_$fields); |
| 6757 | checkGoogleIamV1Policy(response as api.GoogleIamV1Policy); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6758 | }); |
| 6759 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6760 | unittest.test('method--list', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6761 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 6762 | var res = api.CloudMachineLearningEngineApi(mock).projects.models; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6763 | var arg_parent = 'foo'; |
| 6764 | var arg_filter = 'foo'; |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 6765 | var arg_pageSize = 42; |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 6766 | var arg_pageToken = 'foo'; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6767 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 6768 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6769 | var path = (req.url).path; |
| 6770 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6771 | core.int index; |
| 6772 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6773 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6774 | path.substring(pathOffset, pathOffset + 1), |
| 6775 | unittest.equals("/"), |
| 6776 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6777 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6778 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6779 | path.substring(pathOffset, pathOffset + 3), |
| 6780 | unittest.equals("v1/"), |
| 6781 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 6782 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6783 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6784 | |
| 6785 | var query = (req.url).query; |
| 6786 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 6787 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6788 | void addQueryParam(core.String n, core.String v) => |
| 6789 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6790 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6791 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6792 | for (var part in query.split('&')) { |
| 6793 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6794 | addQueryParam( |
| 6795 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6796 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6797 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6798 | } |
| 6799 | } |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 6800 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6801 | queryMap["filter"]!.first, |
| 6802 | unittest.equals(arg_filter), |
| 6803 | ); |
| 6804 | unittest.expect( |
| 6805 | core.int.parse(queryMap["pageSize"]!.first), |
| 6806 | unittest.equals(arg_pageSize), |
| 6807 | ); |
| 6808 | unittest.expect( |
| 6809 | queryMap["pageToken"]!.first, |
| 6810 | unittest.equals(arg_pageToken), |
| 6811 | ); |
| 6812 | unittest.expect( |
| 6813 | queryMap["fields"]!.first, |
| 6814 | unittest.equals(arg_$fields), |
| 6815 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6816 | |
| 6817 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6818 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6819 | }; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6820 | var resp = |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 6821 | convert.json.encode(buildGoogleCloudMlV1ListModelsResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6822 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6823 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6824 | final response = await res.list(arg_parent, |
| 6825 | filter: arg_filter, |
| 6826 | pageSize: arg_pageSize, |
| 6827 | pageToken: arg_pageToken, |
| 6828 | $fields: arg_$fields); |
| 6829 | checkGoogleCloudMlV1ListModelsResponse( |
| 6830 | response as api.GoogleCloudMlV1ListModelsResponse); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 6831 | }); |
| 6832 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6833 | unittest.test('method--patch', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6834 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 6835 | var res = api.CloudMachineLearningEngineApi(mock).projects.models; |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 6836 | var arg_request = buildGoogleCloudMlV1Model(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6837 | var arg_name = 'foo'; |
| 6838 | var arg_updateMask = 'foo'; |
| 6839 | var arg_$fields = 'foo'; |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 6840 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 6841 | var obj = api.GoogleCloudMlV1Model.fromJson( |
| 6842 | json as core.Map<core.String, core.dynamic>); |
| 6843 | checkGoogleCloudMlV1Model(obj as api.GoogleCloudMlV1Model); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 6844 | |
| 6845 | var path = (req.url).path; |
| 6846 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6847 | core.int index; |
| 6848 | core.String subPart; |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 6849 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6850 | path.substring(pathOffset, pathOffset + 1), |
| 6851 | unittest.equals("/"), |
| 6852 | ); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 6853 | pathOffset += 1; |
| 6854 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6855 | path.substring(pathOffset, pathOffset + 3), |
| 6856 | unittest.equals("v1/"), |
| 6857 | ); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 6858 | pathOffset += 3; |
| 6859 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6860 | |
| 6861 | var query = (req.url).query; |
| 6862 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 6863 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6864 | void addQueryParam(core.String n, core.String v) => |
| 6865 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 6866 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6867 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6868 | for (var part in query.split('&')) { |
| 6869 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6870 | addQueryParam( |
| 6871 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6872 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6873 | ); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 6874 | } |
| 6875 | } |
| 6876 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6877 | queryMap["updateMask"]!.first, |
| 6878 | unittest.equals(arg_updateMask), |
| 6879 | ); |
| 6880 | unittest.expect( |
| 6881 | queryMap["fields"]!.first, |
| 6882 | unittest.equals(arg_$fields), |
| 6883 | ); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 6884 | |
| 6885 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6886 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 6887 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 6888 | var resp = convert.json.encode(buildGoogleLongrunningOperation()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6889 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 6890 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6891 | final response = await res.patch(arg_request, arg_name, |
| 6892 | updateMask: arg_updateMask, $fields: arg_$fields); |
| 6893 | checkGoogleLongrunningOperation( |
| 6894 | response as api.GoogleLongrunningOperation); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 6895 | }); |
| 6896 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6897 | unittest.test('method--setIamPolicy', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6898 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 6899 | var res = api.CloudMachineLearningEngineApi(mock).projects.models; |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6900 | var arg_request = buildGoogleIamV1SetIamPolicyRequest(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6901 | var arg_resource = 'foo'; |
| 6902 | var arg_$fields = 'foo'; |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6903 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 6904 | var obj = api.GoogleIamV1SetIamPolicyRequest.fromJson( |
| 6905 | json as core.Map<core.String, core.dynamic>); |
| 6906 | checkGoogleIamV1SetIamPolicyRequest( |
| 6907 | obj as api.GoogleIamV1SetIamPolicyRequest); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6908 | |
| 6909 | var path = (req.url).path; |
| 6910 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6911 | core.int index; |
| 6912 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6913 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6914 | path.substring(pathOffset, pathOffset + 1), |
| 6915 | unittest.equals("/"), |
| 6916 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6917 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6918 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6919 | path.substring(pathOffset, pathOffset + 3), |
| 6920 | unittest.equals("v1/"), |
| 6921 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6922 | pathOffset += 3; |
| 6923 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6924 | |
| 6925 | var query = (req.url).query; |
| 6926 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 6927 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6928 | void addQueryParam(core.String n, core.String v) => |
| 6929 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6930 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6931 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6932 | for (var part in query.split('&')) { |
| 6933 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6934 | addQueryParam( |
| 6935 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6936 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6937 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6938 | } |
| 6939 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6940 | unittest.expect( |
| 6941 | queryMap["fields"]!.first, |
| 6942 | unittest.equals(arg_$fields), |
| 6943 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6944 | |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6945 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6946 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6947 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 6948 | var resp = convert.json.encode(buildGoogleIamV1Policy()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6949 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6950 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6951 | final response = await res.setIamPolicy(arg_request, arg_resource, |
| 6952 | $fields: arg_$fields); |
| 6953 | checkGoogleIamV1Policy(response as api.GoogleIamV1Policy); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6954 | }); |
| 6955 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 6956 | unittest.test('method--testIamPermissions', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6957 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 6958 | var res = api.CloudMachineLearningEngineApi(mock).projects.models; |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6959 | var arg_request = buildGoogleIamV1TestIamPermissionsRequest(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6960 | var arg_resource = 'foo'; |
| 6961 | var arg_$fields = 'foo'; |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6962 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 6963 | var obj = api.GoogleIamV1TestIamPermissionsRequest.fromJson( |
| 6964 | json as core.Map<core.String, core.dynamic>); |
| 6965 | checkGoogleIamV1TestIamPermissionsRequest( |
| 6966 | obj as api.GoogleIamV1TestIamPermissionsRequest); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6967 | |
| 6968 | var path = (req.url).path; |
| 6969 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6970 | core.int index; |
| 6971 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6972 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6973 | path.substring(pathOffset, pathOffset + 1), |
| 6974 | unittest.equals("/"), |
| 6975 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6976 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6977 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6978 | path.substring(pathOffset, pathOffset + 3), |
| 6979 | unittest.equals("v1/"), |
| 6980 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6981 | pathOffset += 3; |
| 6982 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 6983 | |
| 6984 | var query = (req.url).query; |
| 6985 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 6986 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 6987 | void addQueryParam(core.String n, core.String v) => |
| 6988 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 6989 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6990 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6991 | for (var part in query.split('&')) { |
| 6992 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6993 | addQueryParam( |
| 6994 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 6995 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 6996 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 6997 | } |
| 6998 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 6999 | unittest.expect( |
| 7000 | queryMap["fields"]!.first, |
| 7001 | unittest.equals(arg_$fields), |
| 7002 | ); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 7003 | |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 7004 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7005 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 7006 | }; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7007 | var resp = |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7008 | convert.json.encode(buildGoogleIamV1TestIamPermissionsResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7009 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 7010 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7011 | final response = await res.testIamPermissions(arg_request, arg_resource, |
| 7012 | $fields: arg_$fields); |
| 7013 | checkGoogleIamV1TestIamPermissionsResponse( |
| 7014 | response as api.GoogleIamV1TestIamPermissionsResponse); |
Martin Kustermann | 8c5bbda | 2017-07-10 13:23:47 +0200 | [diff] [blame] | 7015 | }); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7016 | }); |
| 7017 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 7018 | unittest.group('resource-ProjectsModelsVersionsResource', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7019 | unittest.test('method--create', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7020 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 7021 | var res = |
| 7022 | api.CloudMachineLearningEngineApi(mock).projects.models.versions; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 7023 | var arg_request = buildGoogleCloudMlV1Version(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7024 | var arg_parent = 'foo'; |
| 7025 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 7026 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 7027 | var obj = api.GoogleCloudMlV1Version.fromJson( |
| 7028 | json as core.Map<core.String, core.dynamic>); |
| 7029 | checkGoogleCloudMlV1Version(obj as api.GoogleCloudMlV1Version); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7030 | |
| 7031 | var path = (req.url).path; |
| 7032 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7033 | core.int index; |
| 7034 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7035 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7036 | path.substring(pathOffset, pathOffset + 1), |
| 7037 | unittest.equals("/"), |
| 7038 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7039 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7040 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7041 | path.substring(pathOffset, pathOffset + 3), |
| 7042 | unittest.equals("v1/"), |
| 7043 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 7044 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7045 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 7046 | |
| 7047 | var query = (req.url).query; |
| 7048 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7049 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 7050 | void addQueryParam(core.String n, core.String v) => |
| 7051 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7052 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7053 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7054 | for (var part in query.split('&')) { |
| 7055 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7056 | addQueryParam( |
| 7057 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 7058 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 7059 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7060 | } |
| 7061 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7062 | unittest.expect( |
| 7063 | queryMap["fields"]!.first, |
| 7064 | unittest.equals(arg_$fields), |
| 7065 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7066 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7067 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7068 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7069 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7070 | var resp = convert.json.encode(buildGoogleLongrunningOperation()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7071 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7072 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7073 | final response = |
| 7074 | await res.create(arg_request, arg_parent, $fields: arg_$fields); |
| 7075 | checkGoogleLongrunningOperation( |
| 7076 | response as api.GoogleLongrunningOperation); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7077 | }); |
| 7078 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7079 | unittest.test('method--delete', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7080 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 7081 | var res = |
| 7082 | api.CloudMachineLearningEngineApi(mock).projects.models.versions; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7083 | var arg_name = 'foo'; |
| 7084 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 7085 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7086 | var path = (req.url).path; |
| 7087 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7088 | core.int index; |
| 7089 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7090 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7091 | path.substring(pathOffset, pathOffset + 1), |
| 7092 | unittest.equals("/"), |
| 7093 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7094 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7095 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7096 | path.substring(pathOffset, pathOffset + 3), |
| 7097 | unittest.equals("v1/"), |
| 7098 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 7099 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7100 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 7101 | |
| 7102 | var query = (req.url).query; |
| 7103 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7104 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 7105 | void addQueryParam(core.String n, core.String v) => |
| 7106 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7107 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7108 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7109 | for (var part in query.split('&')) { |
| 7110 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7111 | addQueryParam( |
| 7112 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 7113 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 7114 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7115 | } |
| 7116 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7117 | unittest.expect( |
| 7118 | queryMap["fields"]!.first, |
| 7119 | unittest.equals(arg_$fields), |
| 7120 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7121 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7122 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7123 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7124 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7125 | var resp = convert.json.encode(buildGoogleLongrunningOperation()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7126 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7127 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7128 | final response = await res.delete(arg_name, $fields: arg_$fields); |
| 7129 | checkGoogleLongrunningOperation( |
| 7130 | response as api.GoogleLongrunningOperation); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7131 | }); |
| 7132 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7133 | unittest.test('method--get', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7134 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 7135 | var res = |
| 7136 | api.CloudMachineLearningEngineApi(mock).projects.models.versions; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7137 | var arg_name = 'foo'; |
| 7138 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 7139 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7140 | var path = (req.url).path; |
| 7141 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7142 | core.int index; |
| 7143 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7144 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7145 | path.substring(pathOffset, pathOffset + 1), |
| 7146 | unittest.equals("/"), |
| 7147 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7148 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7149 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7150 | path.substring(pathOffset, pathOffset + 3), |
| 7151 | unittest.equals("v1/"), |
| 7152 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 7153 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7154 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 7155 | |
| 7156 | var query = (req.url).query; |
| 7157 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7158 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 7159 | void addQueryParam(core.String n, core.String v) => |
| 7160 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7161 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7162 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7163 | for (var part in query.split('&')) { |
| 7164 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7165 | addQueryParam( |
| 7166 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 7167 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 7168 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7169 | } |
| 7170 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7171 | unittest.expect( |
| 7172 | queryMap["fields"]!.first, |
| 7173 | unittest.equals(arg_$fields), |
| 7174 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7175 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7176 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7177 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7178 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7179 | var resp = convert.json.encode(buildGoogleCloudMlV1Version()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7180 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7181 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7182 | final response = await res.get(arg_name, $fields: arg_$fields); |
| 7183 | checkGoogleCloudMlV1Version(response as api.GoogleCloudMlV1Version); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7184 | }); |
| 7185 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7186 | unittest.test('method--list', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7187 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 7188 | var res = |
| 7189 | api.CloudMachineLearningEngineApi(mock).projects.models.versions; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7190 | var arg_parent = 'foo'; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7191 | var arg_filter = 'foo'; |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 7192 | var arg_pageSize = 42; |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 7193 | var arg_pageToken = 'foo'; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7194 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 7195 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7196 | var path = (req.url).path; |
| 7197 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7198 | core.int index; |
| 7199 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7200 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7201 | path.substring(pathOffset, pathOffset + 1), |
| 7202 | unittest.equals("/"), |
| 7203 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7204 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7205 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7206 | path.substring(pathOffset, pathOffset + 3), |
| 7207 | unittest.equals("v1/"), |
| 7208 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 7209 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7210 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 7211 | |
| 7212 | var query = (req.url).query; |
| 7213 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7214 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 7215 | void addQueryParam(core.String n, core.String v) => |
| 7216 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7217 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7218 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7219 | for (var part in query.split('&')) { |
| 7220 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7221 | addQueryParam( |
| 7222 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 7223 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 7224 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7225 | } |
| 7226 | } |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 7227 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7228 | queryMap["filter"]!.first, |
| 7229 | unittest.equals(arg_filter), |
| 7230 | ); |
| 7231 | unittest.expect( |
| 7232 | core.int.parse(queryMap["pageSize"]!.first), |
| 7233 | unittest.equals(arg_pageSize), |
| 7234 | ); |
| 7235 | unittest.expect( |
| 7236 | queryMap["pageToken"]!.first, |
| 7237 | unittest.equals(arg_pageToken), |
| 7238 | ); |
| 7239 | unittest.expect( |
| 7240 | queryMap["fields"]!.first, |
| 7241 | unittest.equals(arg_$fields), |
| 7242 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7243 | |
| 7244 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7245 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7246 | }; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7247 | var resp = |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7248 | convert.json.encode(buildGoogleCloudMlV1ListVersionsResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7249 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7250 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7251 | final response = await res.list(arg_parent, |
| 7252 | filter: arg_filter, |
| 7253 | pageSize: arg_pageSize, |
| 7254 | pageToken: arg_pageToken, |
| 7255 | $fields: arg_$fields); |
| 7256 | checkGoogleCloudMlV1ListVersionsResponse( |
| 7257 | response as api.GoogleCloudMlV1ListVersionsResponse); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7258 | }); |
| 7259 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7260 | unittest.test('method--patch', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7261 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 7262 | var res = |
| 7263 | api.CloudMachineLearningEngineApi(mock).projects.models.versions; |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 7264 | var arg_request = buildGoogleCloudMlV1Version(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7265 | var arg_name = 'foo'; |
| 7266 | var arg_updateMask = 'foo'; |
| 7267 | var arg_$fields = 'foo'; |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 7268 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 7269 | var obj = api.GoogleCloudMlV1Version.fromJson( |
| 7270 | json as core.Map<core.String, core.dynamic>); |
| 7271 | checkGoogleCloudMlV1Version(obj as api.GoogleCloudMlV1Version); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 7272 | |
| 7273 | var path = (req.url).path; |
| 7274 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7275 | core.int index; |
| 7276 | core.String subPart; |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 7277 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7278 | path.substring(pathOffset, pathOffset + 1), |
| 7279 | unittest.equals("/"), |
| 7280 | ); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 7281 | pathOffset += 1; |
| 7282 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7283 | path.substring(pathOffset, pathOffset + 3), |
| 7284 | unittest.equals("v1/"), |
| 7285 | ); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 7286 | pathOffset += 3; |
| 7287 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 7288 | |
| 7289 | var query = (req.url).query; |
| 7290 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7291 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 7292 | void addQueryParam(core.String n, core.String v) => |
| 7293 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 7294 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7295 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7296 | for (var part in query.split('&')) { |
| 7297 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7298 | addQueryParam( |
| 7299 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 7300 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 7301 | ); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 7302 | } |
| 7303 | } |
| 7304 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7305 | queryMap["updateMask"]!.first, |
| 7306 | unittest.equals(arg_updateMask), |
| 7307 | ); |
| 7308 | unittest.expect( |
| 7309 | queryMap["fields"]!.first, |
| 7310 | unittest.equals(arg_$fields), |
| 7311 | ); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 7312 | |
| 7313 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7314 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 7315 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7316 | var resp = convert.json.encode(buildGoogleLongrunningOperation()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7317 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 7318 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7319 | final response = await res.patch(arg_request, arg_name, |
| 7320 | updateMask: arg_updateMask, $fields: arg_$fields); |
| 7321 | checkGoogleLongrunningOperation( |
| 7322 | response as api.GoogleLongrunningOperation); |
Martin Kustermann | 0e13001 | 2017-10-05 15:54:21 +0100 | [diff] [blame] | 7323 | }); |
| 7324 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7325 | unittest.test('method--setDefault', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7326 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 7327 | var res = |
| 7328 | api.CloudMachineLearningEngineApi(mock).projects.models.versions; |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 7329 | var arg_request = buildGoogleCloudMlV1SetDefaultVersionRequest(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7330 | var arg_name = 'foo'; |
| 7331 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 7332 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 7333 | var obj = api.GoogleCloudMlV1SetDefaultVersionRequest.fromJson( |
| 7334 | json as core.Map<core.String, core.dynamic>); |
| 7335 | checkGoogleCloudMlV1SetDefaultVersionRequest( |
| 7336 | obj as api.GoogleCloudMlV1SetDefaultVersionRequest); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7337 | |
| 7338 | var path = (req.url).path; |
| 7339 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7340 | core.int index; |
| 7341 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7342 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7343 | path.substring(pathOffset, pathOffset + 1), |
| 7344 | unittest.equals("/"), |
| 7345 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7346 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7347 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7348 | path.substring(pathOffset, pathOffset + 3), |
| 7349 | unittest.equals("v1/"), |
| 7350 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 7351 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7352 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 7353 | |
| 7354 | var query = (req.url).query; |
| 7355 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7356 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 7357 | void addQueryParam(core.String n, core.String v) => |
| 7358 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7359 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7360 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7361 | for (var part in query.split('&')) { |
| 7362 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7363 | addQueryParam( |
| 7364 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 7365 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 7366 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7367 | } |
| 7368 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7369 | unittest.expect( |
| 7370 | queryMap["fields"]!.first, |
| 7371 | unittest.equals(arg_$fields), |
| 7372 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7373 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7374 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7375 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7376 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7377 | var resp = convert.json.encode(buildGoogleCloudMlV1Version()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7378 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7379 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7380 | final response = |
| 7381 | await res.setDefault(arg_request, arg_name, $fields: arg_$fields); |
| 7382 | checkGoogleCloudMlV1Version(response as api.GoogleCloudMlV1Version); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7383 | }); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7384 | }); |
| 7385 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 7386 | unittest.group('resource-ProjectsOperationsResource', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7387 | unittest.test('method--cancel', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7388 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 7389 | var res = api.CloudMachineLearningEngineApi(mock).projects.operations; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7390 | var arg_name = 'foo'; |
| 7391 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 7392 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7393 | var path = (req.url).path; |
| 7394 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7395 | core.int index; |
| 7396 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7397 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7398 | path.substring(pathOffset, pathOffset + 1), |
| 7399 | unittest.equals("/"), |
| 7400 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7401 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7402 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7403 | path.substring(pathOffset, pathOffset + 3), |
| 7404 | unittest.equals("v1/"), |
| 7405 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 7406 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7407 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 7408 | |
| 7409 | var query = (req.url).query; |
| 7410 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7411 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 7412 | void addQueryParam(core.String n, core.String v) => |
| 7413 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7414 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7415 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7416 | for (var part in query.split('&')) { |
| 7417 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7418 | addQueryParam( |
| 7419 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 7420 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 7421 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7422 | } |
| 7423 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7424 | unittest.expect( |
| 7425 | queryMap["fields"]!.first, |
| 7426 | unittest.equals(arg_$fields), |
| 7427 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7428 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7429 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7430 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7431 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7432 | var resp = convert.json.encode(buildGoogleProtobufEmpty()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7433 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7434 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7435 | final response = await res.cancel(arg_name, $fields: arg_$fields); |
| 7436 | checkGoogleProtobufEmpty(response as api.GoogleProtobufEmpty); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7437 | }); |
| 7438 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7439 | unittest.test('method--get', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7440 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 7441 | var res = api.CloudMachineLearningEngineApi(mock).projects.operations; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7442 | var arg_name = 'foo'; |
| 7443 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 7444 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7445 | var path = (req.url).path; |
| 7446 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7447 | core.int index; |
| 7448 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7449 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7450 | path.substring(pathOffset, pathOffset + 1), |
| 7451 | unittest.equals("/"), |
| 7452 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7453 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7454 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7455 | path.substring(pathOffset, pathOffset + 3), |
| 7456 | unittest.equals("v1/"), |
| 7457 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 7458 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7459 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 7460 | |
| 7461 | var query = (req.url).query; |
| 7462 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7463 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 7464 | void addQueryParam(core.String n, core.String v) => |
| 7465 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7466 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7467 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7468 | for (var part in query.split('&')) { |
| 7469 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7470 | addQueryParam( |
| 7471 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 7472 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 7473 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7474 | } |
| 7475 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7476 | unittest.expect( |
| 7477 | queryMap["fields"]!.first, |
| 7478 | unittest.equals(arg_$fields), |
| 7479 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7480 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7481 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7482 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7483 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7484 | var resp = convert.json.encode(buildGoogleLongrunningOperation()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7485 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7486 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7487 | final response = await res.get(arg_name, $fields: arg_$fields); |
| 7488 | checkGoogleLongrunningOperation( |
| 7489 | response as api.GoogleLongrunningOperation); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7490 | }); |
| 7491 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7492 | unittest.test('method--list', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7493 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 7494 | var res = api.CloudMachineLearningEngineApi(mock).projects.operations; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7495 | var arg_name = 'foo'; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7496 | var arg_filter = 'foo'; |
Jonas Finnemann Jensen | dda12e4 | 2019-02-09 12:37:20 +0100 | [diff] [blame] | 7497 | var arg_pageSize = 42; |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 7498 | var arg_pageToken = 'foo'; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7499 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 7500 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7501 | var path = (req.url).path; |
| 7502 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7503 | core.int index; |
| 7504 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7505 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7506 | path.substring(pathOffset, pathOffset + 1), |
| 7507 | unittest.equals("/"), |
| 7508 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7509 | pathOffset += 1; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7510 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7511 | path.substring(pathOffset, pathOffset + 3), |
| 7512 | unittest.equals("v1/"), |
| 7513 | ); |
Martin Kustermann | a6d0a32 | 2017-03-27 13:52:31 +0200 | [diff] [blame] | 7514 | pathOffset += 3; |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7515 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 7516 | |
| 7517 | var query = (req.url).query; |
| 7518 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7519 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 7520 | void addQueryParam(core.String n, core.String v) => |
| 7521 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7522 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7523 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7524 | for (var part in query.split('&')) { |
| 7525 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7526 | addQueryParam( |
| 7527 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 7528 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 7529 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7530 | } |
| 7531 | } |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 7532 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 7533 | queryMap["filter"]!.first, |
| 7534 | unittest.equals(arg_filter), |
| 7535 | ); |
| 7536 | unittest.expect( |
| 7537 | core.int.parse(queryMap["pageSize"]!.first), |
| 7538 | unittest.equals(arg_pageSize), |
| 7539 | ); |
| 7540 | unittest.expect( |
| 7541 | queryMap["pageToken"]!.first, |
| 7542 | unittest.equals(arg_pageToken), |
| 7543 | ); |
| 7544 | unittest.expect( |
| 7545 | queryMap["fields"]!.first, |
| 7546 | unittest.equals(arg_$fields), |
| 7547 | ); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7548 | |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7549 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7550 | 'content-type': 'application/json; charset=utf-8', |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7551 | }; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 7552 | var resp = |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 7553 | convert.json.encode(buildGoogleLongrunningListOperationsResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 7554 | return async.Future.value(stringResponse(200, h, resp)); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7555 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 7556 | final response = await res.list(arg_name, |
| 7557 | filter: arg_filter, |
| 7558 | pageSize: arg_pageSize, |
| 7559 | pageToken: arg_pageToken, |
| 7560 | $fields: arg_$fields); |
| 7561 | checkGoogleLongrunningListOperationsResponse( |
| 7562 | response as api.GoogleLongrunningListOperationsResponse); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7563 | }); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7564 | }); |
Martin Kustermann | 4ff71db | 2016-11-09 10:46:40 +0100 | [diff] [blame] | 7565 | } |