blob: 9a61b0ef641f40c6f59067294e121a885e27142f [file] [log] [blame]
// ignore_for_file: camel_case_types
// ignore_for_file: comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: directives_ordering
// ignore_for_file: file_names
// ignore_for_file: library_names
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: omit_local_variable_types
// ignore_for_file: prefer_expression_function_bodies
// ignore_for_file: prefer_final_locals
// ignore_for_file: prefer_interpolation_to_compose_strings
// ignore_for_file: unnecessary_brace_in_string_interps
// ignore_for_file: unnecessary_cast
// ignore_for_file: unnecessary_lambdas
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: unnecessary_string_interpolations
// ignore_for_file: avoid_returning_null
// ignore_for_file: cascade_invocations
// ignore_for_file: prefer_single_quotes
// ignore_for_file: unused_local_variable
library googleapis.osconfig.v1.test;
import "dart:core" as core;
import "dart:async" as async;
import "dart:convert" as convert;
import 'package:http/http.dart' as http;
import 'package:test/test.dart' as unittest;
import 'package:googleapis/osconfig/v1.dart' as api;
class HttpServerMock extends http.BaseClient {
core.Function _callback;
core.bool _expectJson;
void register(core.Function callback, core.bool expectJson) {
_callback = callback;
_expectJson = expectJson;
}
@core.override
async.Future<http.StreamedResponse> send(http.BaseRequest request) async {
if (_expectJson) {
final jsonString =
await request.finalize().transform(convert.utf8.decoder).join('');
if (jsonString.isEmpty) {
return _callback(request, null);
} else {
return _callback(request, convert.json.decode(jsonString));
}
} else {
var stream = request.finalize();
if (stream == null) {
return _callback(request, []);
} else {
final data = await stream.toBytes();
return _callback(request, data);
}
}
}
}
http.StreamedResponse stringResponse(core.int status,
core.Map<core.String, core.String> headers, core.String body) {
var stream = async.Stream.fromIterable([convert.utf8.encode(body)]);
return http.StreamedResponse(stream, status, headers: headers);
}
core.List<core.String> buildUnnamed2469() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed2469(core.List<core.String> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals('foo'));
unittest.expect(o[1], unittest.equals('foo'));
}
core.List<core.String> buildUnnamed2470() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed2470(core.List<core.String> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals('foo'));
unittest.expect(o[1], unittest.equals('foo'));
}
core.int buildCounterAptSettings = 0;
api.AptSettings buildAptSettings() {
var o = api.AptSettings();
buildCounterAptSettings++;
if (buildCounterAptSettings < 3) {
o.excludes = buildUnnamed2469();
o.exclusivePackages = buildUnnamed2470();
o.type = 'foo';
}
buildCounterAptSettings--;
return o;
}
void checkAptSettings(api.AptSettings o) {
buildCounterAptSettings++;
if (buildCounterAptSettings < 3) {
checkUnnamed2469(o.excludes);
checkUnnamed2470(o.exclusivePackages);
unittest.expect(o.type, unittest.equals('foo'));
}
buildCounterAptSettings--;
}
core.int buildCounterCancelPatchJobRequest = 0;
api.CancelPatchJobRequest buildCancelPatchJobRequest() {
var o = api.CancelPatchJobRequest();
buildCounterCancelPatchJobRequest++;
if (buildCounterCancelPatchJobRequest < 3) {}
buildCounterCancelPatchJobRequest--;
return o;
}
void checkCancelPatchJobRequest(api.CancelPatchJobRequest o) {
buildCounterCancelPatchJobRequest++;
if (buildCounterCancelPatchJobRequest < 3) {}
buildCounterCancelPatchJobRequest--;
}
core.int buildCounterEmpty = 0;
api.Empty buildEmpty() {
var o = api.Empty();
buildCounterEmpty++;
if (buildCounterEmpty < 3) {}
buildCounterEmpty--;
return o;
}
void checkEmpty(api.Empty o) {
buildCounterEmpty++;
if (buildCounterEmpty < 3) {}
buildCounterEmpty--;
}
core.int buildCounterExecStep = 0;
api.ExecStep buildExecStep() {
var o = api.ExecStep();
buildCounterExecStep++;
if (buildCounterExecStep < 3) {
o.linuxExecStepConfig = buildExecStepConfig();
o.windowsExecStepConfig = buildExecStepConfig();
}
buildCounterExecStep--;
return o;
}
void checkExecStep(api.ExecStep o) {
buildCounterExecStep++;
if (buildCounterExecStep < 3) {
checkExecStepConfig(o.linuxExecStepConfig);
checkExecStepConfig(o.windowsExecStepConfig);
}
buildCounterExecStep--;
}
core.List<core.int> buildUnnamed2471() {
var o = <core.int>[];
o.add(42);
o.add(42);
return o;
}
void checkUnnamed2471(core.List<core.int> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals(42));
unittest.expect(o[1], unittest.equals(42));
}
core.int buildCounterExecStepConfig = 0;
api.ExecStepConfig buildExecStepConfig() {
var o = api.ExecStepConfig();
buildCounterExecStepConfig++;
if (buildCounterExecStepConfig < 3) {
o.allowedSuccessCodes = buildUnnamed2471();
o.gcsObject = buildGcsObject();
o.interpreter = 'foo';
o.localPath = 'foo';
}
buildCounterExecStepConfig--;
return o;
}
void checkExecStepConfig(api.ExecStepConfig o) {
buildCounterExecStepConfig++;
if (buildCounterExecStepConfig < 3) {
checkUnnamed2471(o.allowedSuccessCodes);
checkGcsObject(o.gcsObject);
unittest.expect(o.interpreter, unittest.equals('foo'));
unittest.expect(o.localPath, unittest.equals('foo'));
}
buildCounterExecStepConfig--;
}
core.int buildCounterExecutePatchJobRequest = 0;
api.ExecutePatchJobRequest buildExecutePatchJobRequest() {
var o = api.ExecutePatchJobRequest();
buildCounterExecutePatchJobRequest++;
if (buildCounterExecutePatchJobRequest < 3) {
o.description = 'foo';
o.displayName = 'foo';
o.dryRun = true;
o.duration = 'foo';
o.instanceFilter = buildPatchInstanceFilter();
o.patchConfig = buildPatchConfig();
o.rollout = buildPatchRollout();
}
buildCounterExecutePatchJobRequest--;
return o;
}
void checkExecutePatchJobRequest(api.ExecutePatchJobRequest o) {
buildCounterExecutePatchJobRequest++;
if (buildCounterExecutePatchJobRequest < 3) {
unittest.expect(o.description, unittest.equals('foo'));
unittest.expect(o.displayName, unittest.equals('foo'));
unittest.expect(o.dryRun, unittest.isTrue);
unittest.expect(o.duration, unittest.equals('foo'));
checkPatchInstanceFilter(o.instanceFilter);
checkPatchConfig(o.patchConfig);
checkPatchRollout(o.rollout);
}
buildCounterExecutePatchJobRequest--;
}
core.int buildCounterFixedOrPercent = 0;
api.FixedOrPercent buildFixedOrPercent() {
var o = api.FixedOrPercent();
buildCounterFixedOrPercent++;
if (buildCounterFixedOrPercent < 3) {
o.fixed = 42;
o.percent = 42;
}
buildCounterFixedOrPercent--;
return o;
}
void checkFixedOrPercent(api.FixedOrPercent o) {
buildCounterFixedOrPercent++;
if (buildCounterFixedOrPercent < 3) {
unittest.expect(o.fixed, unittest.equals(42));
unittest.expect(o.percent, unittest.equals(42));
}
buildCounterFixedOrPercent--;
}
core.int buildCounterGcsObject = 0;
api.GcsObject buildGcsObject() {
var o = api.GcsObject();
buildCounterGcsObject++;
if (buildCounterGcsObject < 3) {
o.bucket = 'foo';
o.generationNumber = 'foo';
o.object = 'foo';
}
buildCounterGcsObject--;
return o;
}
void checkGcsObject(api.GcsObject o) {
buildCounterGcsObject++;
if (buildCounterGcsObject < 3) {
unittest.expect(o.bucket, unittest.equals('foo'));
unittest.expect(o.generationNumber, unittest.equals('foo'));
unittest.expect(o.object, unittest.equals('foo'));
}
buildCounterGcsObject--;
}
core.int buildCounterGooSettings = 0;
api.GooSettings buildGooSettings() {
var o = api.GooSettings();
buildCounterGooSettings++;
if (buildCounterGooSettings < 3) {}
buildCounterGooSettings--;
return o;
}
void checkGooSettings(api.GooSettings o) {
buildCounterGooSettings++;
if (buildCounterGooSettings < 3) {}
buildCounterGooSettings--;
}
core.List<api.PatchDeployment> buildUnnamed2472() {
var o = <api.PatchDeployment>[];
o.add(buildPatchDeployment());
o.add(buildPatchDeployment());
return o;
}
void checkUnnamed2472(core.List<api.PatchDeployment> o) {
unittest.expect(o, unittest.hasLength(2));
checkPatchDeployment(o[0]);
checkPatchDeployment(o[1]);
}
core.int buildCounterListPatchDeploymentsResponse = 0;
api.ListPatchDeploymentsResponse buildListPatchDeploymentsResponse() {
var o = api.ListPatchDeploymentsResponse();
buildCounterListPatchDeploymentsResponse++;
if (buildCounterListPatchDeploymentsResponse < 3) {
o.nextPageToken = 'foo';
o.patchDeployments = buildUnnamed2472();
}
buildCounterListPatchDeploymentsResponse--;
return o;
}
void checkListPatchDeploymentsResponse(api.ListPatchDeploymentsResponse o) {
buildCounterListPatchDeploymentsResponse++;
if (buildCounterListPatchDeploymentsResponse < 3) {
unittest.expect(o.nextPageToken, unittest.equals('foo'));
checkUnnamed2472(o.patchDeployments);
}
buildCounterListPatchDeploymentsResponse--;
}
core.List<api.PatchJobInstanceDetails> buildUnnamed2473() {
var o = <api.PatchJobInstanceDetails>[];
o.add(buildPatchJobInstanceDetails());
o.add(buildPatchJobInstanceDetails());
return o;
}
void checkUnnamed2473(core.List<api.PatchJobInstanceDetails> o) {
unittest.expect(o, unittest.hasLength(2));
checkPatchJobInstanceDetails(o[0]);
checkPatchJobInstanceDetails(o[1]);
}
core.int buildCounterListPatchJobInstanceDetailsResponse = 0;
api.ListPatchJobInstanceDetailsResponse
buildListPatchJobInstanceDetailsResponse() {
var o = api.ListPatchJobInstanceDetailsResponse();
buildCounterListPatchJobInstanceDetailsResponse++;
if (buildCounterListPatchJobInstanceDetailsResponse < 3) {
o.nextPageToken = 'foo';
o.patchJobInstanceDetails = buildUnnamed2473();
}
buildCounterListPatchJobInstanceDetailsResponse--;
return o;
}
void checkListPatchJobInstanceDetailsResponse(
api.ListPatchJobInstanceDetailsResponse o) {
buildCounterListPatchJobInstanceDetailsResponse++;
if (buildCounterListPatchJobInstanceDetailsResponse < 3) {
unittest.expect(o.nextPageToken, unittest.equals('foo'));
checkUnnamed2473(o.patchJobInstanceDetails);
}
buildCounterListPatchJobInstanceDetailsResponse--;
}
core.List<api.PatchJob> buildUnnamed2474() {
var o = <api.PatchJob>[];
o.add(buildPatchJob());
o.add(buildPatchJob());
return o;
}
void checkUnnamed2474(core.List<api.PatchJob> o) {
unittest.expect(o, unittest.hasLength(2));
checkPatchJob(o[0]);
checkPatchJob(o[1]);
}
core.int buildCounterListPatchJobsResponse = 0;
api.ListPatchJobsResponse buildListPatchJobsResponse() {
var o = api.ListPatchJobsResponse();
buildCounterListPatchJobsResponse++;
if (buildCounterListPatchJobsResponse < 3) {
o.nextPageToken = 'foo';
o.patchJobs = buildUnnamed2474();
}
buildCounterListPatchJobsResponse--;
return o;
}
void checkListPatchJobsResponse(api.ListPatchJobsResponse o) {
buildCounterListPatchJobsResponse++;
if (buildCounterListPatchJobsResponse < 3) {
unittest.expect(o.nextPageToken, unittest.equals('foo'));
checkUnnamed2474(o.patchJobs);
}
buildCounterListPatchJobsResponse--;
}
core.int buildCounterMonthlySchedule = 0;
api.MonthlySchedule buildMonthlySchedule() {
var o = api.MonthlySchedule();
buildCounterMonthlySchedule++;
if (buildCounterMonthlySchedule < 3) {
o.monthDay = 42;
o.weekDayOfMonth = buildWeekDayOfMonth();
}
buildCounterMonthlySchedule--;
return o;
}
void checkMonthlySchedule(api.MonthlySchedule o) {
buildCounterMonthlySchedule++;
if (buildCounterMonthlySchedule < 3) {
unittest.expect(o.monthDay, unittest.equals(42));
checkWeekDayOfMonth(o.weekDayOfMonth);
}
buildCounterMonthlySchedule--;
}
core.int buildCounterOneTimeSchedule = 0;
api.OneTimeSchedule buildOneTimeSchedule() {
var o = api.OneTimeSchedule();
buildCounterOneTimeSchedule++;
if (buildCounterOneTimeSchedule < 3) {
o.executeTime = 'foo';
}
buildCounterOneTimeSchedule--;
return o;
}
void checkOneTimeSchedule(api.OneTimeSchedule o) {
buildCounterOneTimeSchedule++;
if (buildCounterOneTimeSchedule < 3) {
unittest.expect(o.executeTime, unittest.equals('foo'));
}
buildCounterOneTimeSchedule--;
}
core.int buildCounterPatchConfig = 0;
api.PatchConfig buildPatchConfig() {
var o = api.PatchConfig();
buildCounterPatchConfig++;
if (buildCounterPatchConfig < 3) {
o.apt = buildAptSettings();
o.goo = buildGooSettings();
o.postStep = buildExecStep();
o.preStep = buildExecStep();
o.rebootConfig = 'foo';
o.windowsUpdate = buildWindowsUpdateSettings();
o.yum = buildYumSettings();
o.zypper = buildZypperSettings();
}
buildCounterPatchConfig--;
return o;
}
void checkPatchConfig(api.PatchConfig o) {
buildCounterPatchConfig++;
if (buildCounterPatchConfig < 3) {
checkAptSettings(o.apt);
checkGooSettings(o.goo);
checkExecStep(o.postStep);
checkExecStep(o.preStep);
unittest.expect(o.rebootConfig, unittest.equals('foo'));
checkWindowsUpdateSettings(o.windowsUpdate);
checkYumSettings(o.yum);
checkZypperSettings(o.zypper);
}
buildCounterPatchConfig--;
}
core.int buildCounterPatchDeployment = 0;
api.PatchDeployment buildPatchDeployment() {
var o = api.PatchDeployment();
buildCounterPatchDeployment++;
if (buildCounterPatchDeployment < 3) {
o.createTime = 'foo';
o.description = 'foo';
o.duration = 'foo';
o.instanceFilter = buildPatchInstanceFilter();
o.lastExecuteTime = 'foo';
o.name = 'foo';
o.oneTimeSchedule = buildOneTimeSchedule();
o.patchConfig = buildPatchConfig();
o.recurringSchedule = buildRecurringSchedule();
o.rollout = buildPatchRollout();
o.updateTime = 'foo';
}
buildCounterPatchDeployment--;
return o;
}
void checkPatchDeployment(api.PatchDeployment o) {
buildCounterPatchDeployment++;
if (buildCounterPatchDeployment < 3) {
unittest.expect(o.createTime, unittest.equals('foo'));
unittest.expect(o.description, unittest.equals('foo'));
unittest.expect(o.duration, unittest.equals('foo'));
checkPatchInstanceFilter(o.instanceFilter);
unittest.expect(o.lastExecuteTime, unittest.equals('foo'));
unittest.expect(o.name, unittest.equals('foo'));
checkOneTimeSchedule(o.oneTimeSchedule);
checkPatchConfig(o.patchConfig);
checkRecurringSchedule(o.recurringSchedule);
checkPatchRollout(o.rollout);
unittest.expect(o.updateTime, unittest.equals('foo'));
}
buildCounterPatchDeployment--;
}
core.List<api.PatchInstanceFilterGroupLabel> buildUnnamed2475() {
var o = <api.PatchInstanceFilterGroupLabel>[];
o.add(buildPatchInstanceFilterGroupLabel());
o.add(buildPatchInstanceFilterGroupLabel());
return o;
}
void checkUnnamed2475(core.List<api.PatchInstanceFilterGroupLabel> o) {
unittest.expect(o, unittest.hasLength(2));
checkPatchInstanceFilterGroupLabel(o[0]);
checkPatchInstanceFilterGroupLabel(o[1]);
}
core.List<core.String> buildUnnamed2476() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed2476(core.List<core.String> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals('foo'));
unittest.expect(o[1], unittest.equals('foo'));
}
core.List<core.String> buildUnnamed2477() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed2477(core.List<core.String> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals('foo'));
unittest.expect(o[1], unittest.equals('foo'));
}
core.List<core.String> buildUnnamed2478() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed2478(core.List<core.String> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals('foo'));
unittest.expect(o[1], unittest.equals('foo'));
}
core.int buildCounterPatchInstanceFilter = 0;
api.PatchInstanceFilter buildPatchInstanceFilter() {
var o = api.PatchInstanceFilter();
buildCounterPatchInstanceFilter++;
if (buildCounterPatchInstanceFilter < 3) {
o.all = true;
o.groupLabels = buildUnnamed2475();
o.instanceNamePrefixes = buildUnnamed2476();
o.instances = buildUnnamed2477();
o.zones = buildUnnamed2478();
}
buildCounterPatchInstanceFilter--;
return o;
}
void checkPatchInstanceFilter(api.PatchInstanceFilter o) {
buildCounterPatchInstanceFilter++;
if (buildCounterPatchInstanceFilter < 3) {
unittest.expect(o.all, unittest.isTrue);
checkUnnamed2475(o.groupLabels);
checkUnnamed2476(o.instanceNamePrefixes);
checkUnnamed2477(o.instances);
checkUnnamed2478(o.zones);
}
buildCounterPatchInstanceFilter--;
}
core.Map<core.String, core.String> buildUnnamed2479() {
var o = <core.String, core.String>{};
o['x'] = 'foo';
o['y'] = 'foo';
return o;
}
void checkUnnamed2479(core.Map<core.String, core.String> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o['x'], unittest.equals('foo'));
unittest.expect(o['y'], unittest.equals('foo'));
}
core.int buildCounterPatchInstanceFilterGroupLabel = 0;
api.PatchInstanceFilterGroupLabel buildPatchInstanceFilterGroupLabel() {
var o = api.PatchInstanceFilterGroupLabel();
buildCounterPatchInstanceFilterGroupLabel++;
if (buildCounterPatchInstanceFilterGroupLabel < 3) {
o.labels = buildUnnamed2479();
}
buildCounterPatchInstanceFilterGroupLabel--;
return o;
}
void checkPatchInstanceFilterGroupLabel(api.PatchInstanceFilterGroupLabel o) {
buildCounterPatchInstanceFilterGroupLabel++;
if (buildCounterPatchInstanceFilterGroupLabel < 3) {
checkUnnamed2479(o.labels);
}
buildCounterPatchInstanceFilterGroupLabel--;
}
core.int buildCounterPatchJob = 0;
api.PatchJob buildPatchJob() {
var o = api.PatchJob();
buildCounterPatchJob++;
if (buildCounterPatchJob < 3) {
o.createTime = 'foo';
o.description = 'foo';
o.displayName = 'foo';
o.dryRun = true;
o.duration = 'foo';
o.errorMessage = 'foo';
o.instanceDetailsSummary = buildPatchJobInstanceDetailsSummary();
o.instanceFilter = buildPatchInstanceFilter();
o.name = 'foo';
o.patchConfig = buildPatchConfig();
o.patchDeployment = 'foo';
o.percentComplete = 42.0;
o.rollout = buildPatchRollout();
o.state = 'foo';
o.updateTime = 'foo';
}
buildCounterPatchJob--;
return o;
}
void checkPatchJob(api.PatchJob o) {
buildCounterPatchJob++;
if (buildCounterPatchJob < 3) {
unittest.expect(o.createTime, unittest.equals('foo'));
unittest.expect(o.description, unittest.equals('foo'));
unittest.expect(o.displayName, unittest.equals('foo'));
unittest.expect(o.dryRun, unittest.isTrue);
unittest.expect(o.duration, unittest.equals('foo'));
unittest.expect(o.errorMessage, unittest.equals('foo'));
checkPatchJobInstanceDetailsSummary(o.instanceDetailsSummary);
checkPatchInstanceFilter(o.instanceFilter);
unittest.expect(o.name, unittest.equals('foo'));
checkPatchConfig(o.patchConfig);
unittest.expect(o.patchDeployment, unittest.equals('foo'));
unittest.expect(o.percentComplete, unittest.equals(42.0));
checkPatchRollout(o.rollout);
unittest.expect(o.state, unittest.equals('foo'));
unittest.expect(o.updateTime, unittest.equals('foo'));
}
buildCounterPatchJob--;
}
core.int buildCounterPatchJobInstanceDetails = 0;
api.PatchJobInstanceDetails buildPatchJobInstanceDetails() {
var o = api.PatchJobInstanceDetails();
buildCounterPatchJobInstanceDetails++;
if (buildCounterPatchJobInstanceDetails < 3) {
o.attemptCount = 'foo';
o.failureReason = 'foo';
o.instanceSystemId = 'foo';
o.name = 'foo';
o.state = 'foo';
}
buildCounterPatchJobInstanceDetails--;
return o;
}
void checkPatchJobInstanceDetails(api.PatchJobInstanceDetails o) {
buildCounterPatchJobInstanceDetails++;
if (buildCounterPatchJobInstanceDetails < 3) {
unittest.expect(o.attemptCount, unittest.equals('foo'));
unittest.expect(o.failureReason, unittest.equals('foo'));
unittest.expect(o.instanceSystemId, unittest.equals('foo'));
unittest.expect(o.name, unittest.equals('foo'));
unittest.expect(o.state, unittest.equals('foo'));
}
buildCounterPatchJobInstanceDetails--;
}
core.int buildCounterPatchJobInstanceDetailsSummary = 0;
api.PatchJobInstanceDetailsSummary buildPatchJobInstanceDetailsSummary() {
var o = api.PatchJobInstanceDetailsSummary();
buildCounterPatchJobInstanceDetailsSummary++;
if (buildCounterPatchJobInstanceDetailsSummary < 3) {
o.ackedInstanceCount = 'foo';
o.applyingPatchesInstanceCount = 'foo';
o.downloadingPatchesInstanceCount = 'foo';
o.failedInstanceCount = 'foo';
o.inactiveInstanceCount = 'foo';
o.noAgentDetectedInstanceCount = 'foo';
o.notifiedInstanceCount = 'foo';
o.pendingInstanceCount = 'foo';
o.postPatchStepInstanceCount = 'foo';
o.prePatchStepInstanceCount = 'foo';
o.rebootingInstanceCount = 'foo';
o.startedInstanceCount = 'foo';
o.succeededInstanceCount = 'foo';
o.succeededRebootRequiredInstanceCount = 'foo';
o.timedOutInstanceCount = 'foo';
}
buildCounterPatchJobInstanceDetailsSummary--;
return o;
}
void checkPatchJobInstanceDetailsSummary(api.PatchJobInstanceDetailsSummary o) {
buildCounterPatchJobInstanceDetailsSummary++;
if (buildCounterPatchJobInstanceDetailsSummary < 3) {
unittest.expect(o.ackedInstanceCount, unittest.equals('foo'));
unittest.expect(o.applyingPatchesInstanceCount, unittest.equals('foo'));
unittest.expect(o.downloadingPatchesInstanceCount, unittest.equals('foo'));
unittest.expect(o.failedInstanceCount, unittest.equals('foo'));
unittest.expect(o.inactiveInstanceCount, unittest.equals('foo'));
unittest.expect(o.noAgentDetectedInstanceCount, unittest.equals('foo'));
unittest.expect(o.notifiedInstanceCount, unittest.equals('foo'));
unittest.expect(o.pendingInstanceCount, unittest.equals('foo'));
unittest.expect(o.postPatchStepInstanceCount, unittest.equals('foo'));
unittest.expect(o.prePatchStepInstanceCount, unittest.equals('foo'));
unittest.expect(o.rebootingInstanceCount, unittest.equals('foo'));
unittest.expect(o.startedInstanceCount, unittest.equals('foo'));
unittest.expect(o.succeededInstanceCount, unittest.equals('foo'));
unittest.expect(
o.succeededRebootRequiredInstanceCount, unittest.equals('foo'));
unittest.expect(o.timedOutInstanceCount, unittest.equals('foo'));
}
buildCounterPatchJobInstanceDetailsSummary--;
}
core.int buildCounterPatchRollout = 0;
api.PatchRollout buildPatchRollout() {
var o = api.PatchRollout();
buildCounterPatchRollout++;
if (buildCounterPatchRollout < 3) {
o.disruptionBudget = buildFixedOrPercent();
o.mode = 'foo';
}
buildCounterPatchRollout--;
return o;
}
void checkPatchRollout(api.PatchRollout o) {
buildCounterPatchRollout++;
if (buildCounterPatchRollout < 3) {
checkFixedOrPercent(o.disruptionBudget);
unittest.expect(o.mode, unittest.equals('foo'));
}
buildCounterPatchRollout--;
}
core.int buildCounterRecurringSchedule = 0;
api.RecurringSchedule buildRecurringSchedule() {
var o = api.RecurringSchedule();
buildCounterRecurringSchedule++;
if (buildCounterRecurringSchedule < 3) {
o.endTime = 'foo';
o.frequency = 'foo';
o.lastExecuteTime = 'foo';
o.monthly = buildMonthlySchedule();
o.nextExecuteTime = 'foo';
o.startTime = 'foo';
o.timeOfDay = buildTimeOfDay();
o.timeZone = buildTimeZone();
o.weekly = buildWeeklySchedule();
}
buildCounterRecurringSchedule--;
return o;
}
void checkRecurringSchedule(api.RecurringSchedule o) {
buildCounterRecurringSchedule++;
if (buildCounterRecurringSchedule < 3) {
unittest.expect(o.endTime, unittest.equals('foo'));
unittest.expect(o.frequency, unittest.equals('foo'));
unittest.expect(o.lastExecuteTime, unittest.equals('foo'));
checkMonthlySchedule(o.monthly);
unittest.expect(o.nextExecuteTime, unittest.equals('foo'));
unittest.expect(o.startTime, unittest.equals('foo'));
checkTimeOfDay(o.timeOfDay);
checkTimeZone(o.timeZone);
checkWeeklySchedule(o.weekly);
}
buildCounterRecurringSchedule--;
}
core.int buildCounterTimeOfDay = 0;
api.TimeOfDay buildTimeOfDay() {
var o = api.TimeOfDay();
buildCounterTimeOfDay++;
if (buildCounterTimeOfDay < 3) {
o.hours = 42;
o.minutes = 42;
o.nanos = 42;
o.seconds = 42;
}
buildCounterTimeOfDay--;
return o;
}
void checkTimeOfDay(api.TimeOfDay o) {
buildCounterTimeOfDay++;
if (buildCounterTimeOfDay < 3) {
unittest.expect(o.hours, unittest.equals(42));
unittest.expect(o.minutes, unittest.equals(42));
unittest.expect(o.nanos, unittest.equals(42));
unittest.expect(o.seconds, unittest.equals(42));
}
buildCounterTimeOfDay--;
}
core.int buildCounterTimeZone = 0;
api.TimeZone buildTimeZone() {
var o = api.TimeZone();
buildCounterTimeZone++;
if (buildCounterTimeZone < 3) {
o.id = 'foo';
o.version = 'foo';
}
buildCounterTimeZone--;
return o;
}
void checkTimeZone(api.TimeZone o) {
buildCounterTimeZone++;
if (buildCounterTimeZone < 3) {
unittest.expect(o.id, unittest.equals('foo'));
unittest.expect(o.version, unittest.equals('foo'));
}
buildCounterTimeZone--;
}
core.int buildCounterWeekDayOfMonth = 0;
api.WeekDayOfMonth buildWeekDayOfMonth() {
var o = api.WeekDayOfMonth();
buildCounterWeekDayOfMonth++;
if (buildCounterWeekDayOfMonth < 3) {
o.dayOfWeek = 'foo';
o.weekOrdinal = 42;
}
buildCounterWeekDayOfMonth--;
return o;
}
void checkWeekDayOfMonth(api.WeekDayOfMonth o) {
buildCounterWeekDayOfMonth++;
if (buildCounterWeekDayOfMonth < 3) {
unittest.expect(o.dayOfWeek, unittest.equals('foo'));
unittest.expect(o.weekOrdinal, unittest.equals(42));
}
buildCounterWeekDayOfMonth--;
}
core.int buildCounterWeeklySchedule = 0;
api.WeeklySchedule buildWeeklySchedule() {
var o = api.WeeklySchedule();
buildCounterWeeklySchedule++;
if (buildCounterWeeklySchedule < 3) {
o.dayOfWeek = 'foo';
}
buildCounterWeeklySchedule--;
return o;
}
void checkWeeklySchedule(api.WeeklySchedule o) {
buildCounterWeeklySchedule++;
if (buildCounterWeeklySchedule < 3) {
unittest.expect(o.dayOfWeek, unittest.equals('foo'));
}
buildCounterWeeklySchedule--;
}
core.List<core.String> buildUnnamed2480() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed2480(core.List<core.String> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals('foo'));
unittest.expect(o[1], unittest.equals('foo'));
}
core.List<core.String> buildUnnamed2481() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed2481(core.List<core.String> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals('foo'));
unittest.expect(o[1], unittest.equals('foo'));
}
core.List<core.String> buildUnnamed2482() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed2482(core.List<core.String> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals('foo'));
unittest.expect(o[1], unittest.equals('foo'));
}
core.int buildCounterWindowsUpdateSettings = 0;
api.WindowsUpdateSettings buildWindowsUpdateSettings() {
var o = api.WindowsUpdateSettings();
buildCounterWindowsUpdateSettings++;
if (buildCounterWindowsUpdateSettings < 3) {
o.classifications = buildUnnamed2480();
o.excludes = buildUnnamed2481();
o.exclusivePatches = buildUnnamed2482();
}
buildCounterWindowsUpdateSettings--;
return o;
}
void checkWindowsUpdateSettings(api.WindowsUpdateSettings o) {
buildCounterWindowsUpdateSettings++;
if (buildCounterWindowsUpdateSettings < 3) {
checkUnnamed2480(o.classifications);
checkUnnamed2481(o.excludes);
checkUnnamed2482(o.exclusivePatches);
}
buildCounterWindowsUpdateSettings--;
}
core.List<core.String> buildUnnamed2483() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed2483(core.List<core.String> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals('foo'));
unittest.expect(o[1], unittest.equals('foo'));
}
core.List<core.String> buildUnnamed2484() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed2484(core.List<core.String> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals('foo'));
unittest.expect(o[1], unittest.equals('foo'));
}
core.int buildCounterYumSettings = 0;
api.YumSettings buildYumSettings() {
var o = api.YumSettings();
buildCounterYumSettings++;
if (buildCounterYumSettings < 3) {
o.excludes = buildUnnamed2483();
o.exclusivePackages = buildUnnamed2484();
o.minimal = true;
o.security = true;
}
buildCounterYumSettings--;
return o;
}
void checkYumSettings(api.YumSettings o) {
buildCounterYumSettings++;
if (buildCounterYumSettings < 3) {
checkUnnamed2483(o.excludes);
checkUnnamed2484(o.exclusivePackages);
unittest.expect(o.minimal, unittest.isTrue);
unittest.expect(o.security, unittest.isTrue);
}
buildCounterYumSettings--;
}
core.List<core.String> buildUnnamed2485() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed2485(core.List<core.String> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals('foo'));
unittest.expect(o[1], unittest.equals('foo'));
}
core.List<core.String> buildUnnamed2486() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed2486(core.List<core.String> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals('foo'));
unittest.expect(o[1], unittest.equals('foo'));
}
core.List<core.String> buildUnnamed2487() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed2487(core.List<core.String> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals('foo'));
unittest.expect(o[1], unittest.equals('foo'));
}
core.List<core.String> buildUnnamed2488() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed2488(core.List<core.String> o) {
unittest.expect(o, unittest.hasLength(2));
unittest.expect(o[0], unittest.equals('foo'));
unittest.expect(o[1], unittest.equals('foo'));
}
core.int buildCounterZypperSettings = 0;
api.ZypperSettings buildZypperSettings() {
var o = api.ZypperSettings();
buildCounterZypperSettings++;
if (buildCounterZypperSettings < 3) {
o.categories = buildUnnamed2485();
o.excludes = buildUnnamed2486();
o.exclusivePatches = buildUnnamed2487();
o.severities = buildUnnamed2488();
o.withOptional = true;
o.withUpdate = true;
}
buildCounterZypperSettings--;
return o;
}
void checkZypperSettings(api.ZypperSettings o) {
buildCounterZypperSettings++;
if (buildCounterZypperSettings < 3) {
checkUnnamed2485(o.categories);
checkUnnamed2486(o.excludes);
checkUnnamed2487(o.exclusivePatches);
checkUnnamed2488(o.severities);
unittest.expect(o.withOptional, unittest.isTrue);
unittest.expect(o.withUpdate, unittest.isTrue);
}
buildCounterZypperSettings--;
}
void main() {
unittest.group('obj-schema-AptSettings', () {
unittest.test('to-json--from-json', () {
var o = buildAptSettings();
var od = api.AptSettings.fromJson(o.toJson());
checkAptSettings(od);
});
});
unittest.group('obj-schema-CancelPatchJobRequest', () {
unittest.test('to-json--from-json', () {
var o = buildCancelPatchJobRequest();
var od = api.CancelPatchJobRequest.fromJson(o.toJson());
checkCancelPatchJobRequest(od);
});
});
unittest.group('obj-schema-Empty', () {
unittest.test('to-json--from-json', () {
var o = buildEmpty();
var od = api.Empty.fromJson(o.toJson());
checkEmpty(od);
});
});
unittest.group('obj-schema-ExecStep', () {
unittest.test('to-json--from-json', () {
var o = buildExecStep();
var od = api.ExecStep.fromJson(o.toJson());
checkExecStep(od);
});
});
unittest.group('obj-schema-ExecStepConfig', () {
unittest.test('to-json--from-json', () {
var o = buildExecStepConfig();
var od = api.ExecStepConfig.fromJson(o.toJson());
checkExecStepConfig(od);
});
});
unittest.group('obj-schema-ExecutePatchJobRequest', () {
unittest.test('to-json--from-json', () {
var o = buildExecutePatchJobRequest();
var od = api.ExecutePatchJobRequest.fromJson(o.toJson());
checkExecutePatchJobRequest(od);
});
});
unittest.group('obj-schema-FixedOrPercent', () {
unittest.test('to-json--from-json', () {
var o = buildFixedOrPercent();
var od = api.FixedOrPercent.fromJson(o.toJson());
checkFixedOrPercent(od);
});
});
unittest.group('obj-schema-GcsObject', () {
unittest.test('to-json--from-json', () {
var o = buildGcsObject();
var od = api.GcsObject.fromJson(o.toJson());
checkGcsObject(od);
});
});
unittest.group('obj-schema-GooSettings', () {
unittest.test('to-json--from-json', () {
var o = buildGooSettings();
var od = api.GooSettings.fromJson(o.toJson());
checkGooSettings(od);
});
});
unittest.group('obj-schema-ListPatchDeploymentsResponse', () {
unittest.test('to-json--from-json', () {
var o = buildListPatchDeploymentsResponse();
var od = api.ListPatchDeploymentsResponse.fromJson(o.toJson());
checkListPatchDeploymentsResponse(od);
});
});
unittest.group('obj-schema-ListPatchJobInstanceDetailsResponse', () {
unittest.test('to-json--from-json', () {
var o = buildListPatchJobInstanceDetailsResponse();
var od = api.ListPatchJobInstanceDetailsResponse.fromJson(o.toJson());
checkListPatchJobInstanceDetailsResponse(od);
});
});
unittest.group('obj-schema-ListPatchJobsResponse', () {
unittest.test('to-json--from-json', () {
var o = buildListPatchJobsResponse();
var od = api.ListPatchJobsResponse.fromJson(o.toJson());
checkListPatchJobsResponse(od);
});
});
unittest.group('obj-schema-MonthlySchedule', () {
unittest.test('to-json--from-json', () {
var o = buildMonthlySchedule();
var od = api.MonthlySchedule.fromJson(o.toJson());
checkMonthlySchedule(od);
});
});
unittest.group('obj-schema-OneTimeSchedule', () {
unittest.test('to-json--from-json', () {
var o = buildOneTimeSchedule();
var od = api.OneTimeSchedule.fromJson(o.toJson());
checkOneTimeSchedule(od);
});
});
unittest.group('obj-schema-PatchConfig', () {
unittest.test('to-json--from-json', () {
var o = buildPatchConfig();
var od = api.PatchConfig.fromJson(o.toJson());
checkPatchConfig(od);
});
});
unittest.group('obj-schema-PatchDeployment', () {
unittest.test('to-json--from-json', () {
var o = buildPatchDeployment();
var od = api.PatchDeployment.fromJson(o.toJson());
checkPatchDeployment(od);
});
});
unittest.group('obj-schema-PatchInstanceFilter', () {
unittest.test('to-json--from-json', () {
var o = buildPatchInstanceFilter();
var od = api.PatchInstanceFilter.fromJson(o.toJson());
checkPatchInstanceFilter(od);
});
});
unittest.group('obj-schema-PatchInstanceFilterGroupLabel', () {
unittest.test('to-json--from-json', () {
var o = buildPatchInstanceFilterGroupLabel();
var od = api.PatchInstanceFilterGroupLabel.fromJson(o.toJson());
checkPatchInstanceFilterGroupLabel(od);
});
});
unittest.group('obj-schema-PatchJob', () {
unittest.test('to-json--from-json', () {
var o = buildPatchJob();
var od = api.PatchJob.fromJson(o.toJson());
checkPatchJob(od);
});
});
unittest.group('obj-schema-PatchJobInstanceDetails', () {
unittest.test('to-json--from-json', () {
var o = buildPatchJobInstanceDetails();
var od = api.PatchJobInstanceDetails.fromJson(o.toJson());
checkPatchJobInstanceDetails(od);
});
});
unittest.group('obj-schema-PatchJobInstanceDetailsSummary', () {
unittest.test('to-json--from-json', () {
var o = buildPatchJobInstanceDetailsSummary();
var od = api.PatchJobInstanceDetailsSummary.fromJson(o.toJson());
checkPatchJobInstanceDetailsSummary(od);
});
});
unittest.group('obj-schema-PatchRollout', () {
unittest.test('to-json--from-json', () {
var o = buildPatchRollout();
var od = api.PatchRollout.fromJson(o.toJson());
checkPatchRollout(od);
});
});
unittest.group('obj-schema-RecurringSchedule', () {
unittest.test('to-json--from-json', () {
var o = buildRecurringSchedule();
var od = api.RecurringSchedule.fromJson(o.toJson());
checkRecurringSchedule(od);
});
});
unittest.group('obj-schema-TimeOfDay', () {
unittest.test('to-json--from-json', () {
var o = buildTimeOfDay();
var od = api.TimeOfDay.fromJson(o.toJson());
checkTimeOfDay(od);
});
});
unittest.group('obj-schema-TimeZone', () {
unittest.test('to-json--from-json', () {
var o = buildTimeZone();
var od = api.TimeZone.fromJson(o.toJson());
checkTimeZone(od);
});
});
unittest.group('obj-schema-WeekDayOfMonth', () {
unittest.test('to-json--from-json', () {
var o = buildWeekDayOfMonth();
var od = api.WeekDayOfMonth.fromJson(o.toJson());
checkWeekDayOfMonth(od);
});
});
unittest.group('obj-schema-WeeklySchedule', () {
unittest.test('to-json--from-json', () {
var o = buildWeeklySchedule();
var od = api.WeeklySchedule.fromJson(o.toJson());
checkWeeklySchedule(od);
});
});
unittest.group('obj-schema-WindowsUpdateSettings', () {
unittest.test('to-json--from-json', () {
var o = buildWindowsUpdateSettings();
var od = api.WindowsUpdateSettings.fromJson(o.toJson());
checkWindowsUpdateSettings(od);
});
});
unittest.group('obj-schema-YumSettings', () {
unittest.test('to-json--from-json', () {
var o = buildYumSettings();
var od = api.YumSettings.fromJson(o.toJson());
checkYumSettings(od);
});
});
unittest.group('obj-schema-ZypperSettings', () {
unittest.test('to-json--from-json', () {
var o = buildZypperSettings();
var od = api.ZypperSettings.fromJson(o.toJson());
checkZypperSettings(od);
});
});
unittest.group('resource-ProjectsPatchDeploymentsResourceApi', () {
unittest.test('method--create', () {
var mock = HttpServerMock();
api.ProjectsPatchDeploymentsResourceApi res =
api.OsconfigApi(mock).projects.patchDeployments;
var arg_request = buildPatchDeployment();
var arg_parent = 'foo';
var arg_patchDeploymentId = 'foo';
var arg_$fields = 'foo';
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var obj = api.PatchDeployment.fromJson(json);
checkPatchDeployment(obj);
var path = (req.url).path;
var pathOffset = 0;
core.int index;
core.String subPart;
unittest.expect(
path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
pathOffset += 1;
unittest.expect(
path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
pathOffset += 3;
// NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
var query = (req.url).query;
var queryOffset = 0;
var queryMap = <core.String, core.List<core.String>>{};
void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
if (query.isNotEmpty) {
for (var part in query.split('&')) {
var keyValue = part.split('=');
addQueryParam(
core.Uri.decodeQueryComponent(keyValue[0]),
core.Uri.decodeQueryComponent(keyValue[1]),
);
}
}
unittest.expect(queryMap["patchDeploymentId"].first,
unittest.equals(arg_patchDeploymentId));
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp = convert.json.encode(buildPatchDeployment());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.create(arg_request, arg_parent,
patchDeploymentId: arg_patchDeploymentId, $fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkPatchDeployment(response);
})));
});
unittest.test('method--delete', () {
var mock = HttpServerMock();
api.ProjectsPatchDeploymentsResourceApi res =
api.OsconfigApi(mock).projects.patchDeployments;
var arg_name = 'foo';
var arg_$fields = 'foo';
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
var pathOffset = 0;
core.int index;
core.String subPart;
unittest.expect(
path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
pathOffset += 1;
unittest.expect(
path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
pathOffset += 3;
// NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
var query = (req.url).query;
var queryOffset = 0;
var queryMap = <core.String, core.List<core.String>>{};
void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
if (query.isNotEmpty) {
for (var part in query.split('&')) {
var keyValue = part.split('=');
addQueryParam(
core.Uri.decodeQueryComponent(keyValue[0]),
core.Uri.decodeQueryComponent(keyValue[1]),
);
}
}
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp = convert.json.encode(buildEmpty());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.delete(arg_name, $fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkEmpty(response);
})));
});
unittest.test('method--get', () {
var mock = HttpServerMock();
api.ProjectsPatchDeploymentsResourceApi res =
api.OsconfigApi(mock).projects.patchDeployments;
var arg_name = 'foo';
var arg_$fields = 'foo';
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
var pathOffset = 0;
core.int index;
core.String subPart;
unittest.expect(
path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
pathOffset += 1;
unittest.expect(
path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
pathOffset += 3;
// NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
var query = (req.url).query;
var queryOffset = 0;
var queryMap = <core.String, core.List<core.String>>{};
void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
if (query.isNotEmpty) {
for (var part in query.split('&')) {
var keyValue = part.split('=');
addQueryParam(
core.Uri.decodeQueryComponent(keyValue[0]),
core.Uri.decodeQueryComponent(keyValue[1]),
);
}
}
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp = convert.json.encode(buildPatchDeployment());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.get(arg_name, $fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkPatchDeployment(response);
})));
});
unittest.test('method--list', () {
var mock = HttpServerMock();
api.ProjectsPatchDeploymentsResourceApi res =
api.OsconfigApi(mock).projects.patchDeployments;
var arg_parent = 'foo';
var arg_pageSize = 42;
var arg_pageToken = 'foo';
var arg_$fields = 'foo';
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
var pathOffset = 0;
core.int index;
core.String subPart;
unittest.expect(
path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
pathOffset += 1;
unittest.expect(
path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
pathOffset += 3;
// NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
var query = (req.url).query;
var queryOffset = 0;
var queryMap = <core.String, core.List<core.String>>{};
void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
if (query.isNotEmpty) {
for (var part in query.split('&')) {
var keyValue = part.split('=');
addQueryParam(
core.Uri.decodeQueryComponent(keyValue[0]),
core.Uri.decodeQueryComponent(keyValue[1]),
);
}
}
unittest.expect(core.int.parse(queryMap["pageSize"].first),
unittest.equals(arg_pageSize));
unittest.expect(
queryMap["pageToken"].first, unittest.equals(arg_pageToken));
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp = convert.json.encode(buildListPatchDeploymentsResponse());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.list(arg_parent,
pageSize: arg_pageSize,
pageToken: arg_pageToken,
$fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkListPatchDeploymentsResponse(response);
})));
});
});
unittest.group('resource-ProjectsPatchJobsResourceApi', () {
unittest.test('method--cancel', () {
var mock = HttpServerMock();
api.ProjectsPatchJobsResourceApi res =
api.OsconfigApi(mock).projects.patchJobs;
var arg_request = buildCancelPatchJobRequest();
var arg_name = 'foo';
var arg_$fields = 'foo';
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var obj = api.CancelPatchJobRequest.fromJson(json);
checkCancelPatchJobRequest(obj);
var path = (req.url).path;
var pathOffset = 0;
core.int index;
core.String subPart;
unittest.expect(
path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
pathOffset += 1;
unittest.expect(
path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
pathOffset += 3;
// NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
var query = (req.url).query;
var queryOffset = 0;
var queryMap = <core.String, core.List<core.String>>{};
void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
if (query.isNotEmpty) {
for (var part in query.split('&')) {
var keyValue = part.split('=');
addQueryParam(
core.Uri.decodeQueryComponent(keyValue[0]),
core.Uri.decodeQueryComponent(keyValue[1]),
);
}
}
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp = convert.json.encode(buildPatchJob());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.cancel(arg_request, arg_name, $fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkPatchJob(response);
})));
});
unittest.test('method--execute', () {
var mock = HttpServerMock();
api.ProjectsPatchJobsResourceApi res =
api.OsconfigApi(mock).projects.patchJobs;
var arg_request = buildExecutePatchJobRequest();
var arg_parent = 'foo';
var arg_$fields = 'foo';
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var obj = api.ExecutePatchJobRequest.fromJson(json);
checkExecutePatchJobRequest(obj);
var path = (req.url).path;
var pathOffset = 0;
core.int index;
core.String subPart;
unittest.expect(
path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
pathOffset += 1;
unittest.expect(
path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
pathOffset += 3;
// NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
var query = (req.url).query;
var queryOffset = 0;
var queryMap = <core.String, core.List<core.String>>{};
void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
if (query.isNotEmpty) {
for (var part in query.split('&')) {
var keyValue = part.split('=');
addQueryParam(
core.Uri.decodeQueryComponent(keyValue[0]),
core.Uri.decodeQueryComponent(keyValue[1]),
);
}
}
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp = convert.json.encode(buildPatchJob());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.execute(arg_request, arg_parent, $fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkPatchJob(response);
})));
});
unittest.test('method--get', () {
var mock = HttpServerMock();
api.ProjectsPatchJobsResourceApi res =
api.OsconfigApi(mock).projects.patchJobs;
var arg_name = 'foo';
var arg_$fields = 'foo';
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
var pathOffset = 0;
core.int index;
core.String subPart;
unittest.expect(
path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
pathOffset += 1;
unittest.expect(
path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
pathOffset += 3;
// NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
var query = (req.url).query;
var queryOffset = 0;
var queryMap = <core.String, core.List<core.String>>{};
void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
if (query.isNotEmpty) {
for (var part in query.split('&')) {
var keyValue = part.split('=');
addQueryParam(
core.Uri.decodeQueryComponent(keyValue[0]),
core.Uri.decodeQueryComponent(keyValue[1]),
);
}
}
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp = convert.json.encode(buildPatchJob());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.get(arg_name, $fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkPatchJob(response);
})));
});
unittest.test('method--list', () {
var mock = HttpServerMock();
api.ProjectsPatchJobsResourceApi res =
api.OsconfigApi(mock).projects.patchJobs;
var arg_parent = 'foo';
var arg_filter = 'foo';
var arg_pageSize = 42;
var arg_pageToken = 'foo';
var arg_$fields = 'foo';
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
var pathOffset = 0;
core.int index;
core.String subPart;
unittest.expect(
path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
pathOffset += 1;
unittest.expect(
path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
pathOffset += 3;
// NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
var query = (req.url).query;
var queryOffset = 0;
var queryMap = <core.String, core.List<core.String>>{};
void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
if (query.isNotEmpty) {
for (var part in query.split('&')) {
var keyValue = part.split('=');
addQueryParam(
core.Uri.decodeQueryComponent(keyValue[0]),
core.Uri.decodeQueryComponent(keyValue[1]),
);
}
}
unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter));
unittest.expect(core.int.parse(queryMap["pageSize"].first),
unittest.equals(arg_pageSize));
unittest.expect(
queryMap["pageToken"].first, unittest.equals(arg_pageToken));
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp = convert.json.encode(buildListPatchJobsResponse());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.list(arg_parent,
filter: arg_filter,
pageSize: arg_pageSize,
pageToken: arg_pageToken,
$fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkListPatchJobsResponse(response);
})));
});
});
unittest.group('resource-ProjectsPatchJobsInstanceDetailsResourceApi', () {
unittest.test('method--list', () {
var mock = HttpServerMock();
api.ProjectsPatchJobsInstanceDetailsResourceApi res =
api.OsconfigApi(mock).projects.patchJobs.instanceDetails;
var arg_parent = 'foo';
var arg_filter = 'foo';
var arg_pageSize = 42;
var arg_pageToken = 'foo';
var arg_$fields = 'foo';
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
var pathOffset = 0;
core.int index;
core.String subPart;
unittest.expect(
path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
pathOffset += 1;
unittest.expect(
path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
pathOffset += 3;
// NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
var query = (req.url).query;
var queryOffset = 0;
var queryMap = <core.String, core.List<core.String>>{};
void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
if (query.isNotEmpty) {
for (var part in query.split('&')) {
var keyValue = part.split('=');
addQueryParam(
core.Uri.decodeQueryComponent(keyValue[0]),
core.Uri.decodeQueryComponent(keyValue[1]),
);
}
}
unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter));
unittest.expect(core.int.parse(queryMap["pageSize"].first),
unittest.equals(arg_pageSize));
unittest.expect(
queryMap["pageToken"].first, unittest.equals(arg_pageToken));
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp =
convert.json.encode(buildListPatchJobInstanceDetailsResponse());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.list(arg_parent,
filter: arg_filter,
pageSize: arg_pageSize,
pageToken: arg_pageToken,
$fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkListPatchJobInstanceDetailsResponse(response);
})));
});
});
}