Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code: List responses return empty list instead of null #4104

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,9 @@ public String extractNextToken(ListDatasetsResponse payload) {

@Override
public Iterable<Dataset> extractResources(ListDatasetsResponse payload) {
return payload.getDatasetsList();
return payload.getDatasetsList() != null
? payload.getDatasetsList()
: ImmutableList.<Dataset>of();
}
};

Expand Down Expand Up @@ -405,7 +407,9 @@ public String extractNextToken(ListModelsResponse payload) {

@Override
public Iterable<Model> extractResources(ListModelsResponse payload) {
return payload.getModelList();
return payload.getModelList() != null
? payload.getModelList()
: ImmutableList.<Model>of();
}
};

Expand Down Expand Up @@ -444,7 +448,9 @@ public String extractNextToken(ListModelEvaluationsResponse payload) {
@Override
public Iterable<ModelEvaluation> extractResources(
ListModelEvaluationsResponse payload) {
return payload.getModelEvaluationList();
return payload.getModelEvaluationList() != null
? payload.getModelEvaluationList()
: ImmutableList.<ModelEvaluation>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,9 @@ public String extractNextToken(ListDataSourcesResponse payload) {

@Override
public Iterable<DataSource> extractResources(ListDataSourcesResponse payload) {
return payload.getDataSourcesList();
return payload.getDataSourcesList() != null
? payload.getDataSourcesList()
: ImmutableList.<DataSource>of();
}
};

Expand Down Expand Up @@ -367,7 +369,9 @@ public String extractNextToken(ListTransferConfigsResponse payload) {

@Override
public Iterable<TransferConfig> extractResources(ListTransferConfigsResponse payload) {
return payload.getTransferConfigsList();
return payload.getTransferConfigsList() != null
? payload.getTransferConfigsList()
: ImmutableList.<TransferConfig>of();
}
};

Expand Down Expand Up @@ -405,7 +409,9 @@ public String extractNextToken(ListTransferRunsResponse payload) {

@Override
public Iterable<TransferRun> extractResources(ListTransferRunsResponse payload) {
return payload.getTransferRunsList();
return payload.getTransferRunsList() != null
? payload.getTransferRunsList()
: ImmutableList.<TransferRun>of();
}
};

Expand Down Expand Up @@ -443,7 +449,9 @@ public String extractNextToken(ListTransferLogsResponse payload) {

@Override
public Iterable<TransferMessage> extractResources(ListTransferLogsResponse payload) {
return payload.getTransferMessagesList();
return payload.getTransferMessagesList() != null
? payload.getTransferMessagesList()
: ImmutableList.<TransferMessage>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,9 @@ public String extractNextToken(ListAppProfilesResponse payload) {

@Override
public Iterable<AppProfile> extractResources(ListAppProfilesResponse payload) {
return payload.getAppProfilesList();
return payload.getAppProfilesList() != null
? payload.getAppProfilesList()
: ImmutableList.<AppProfile>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ public String extractNextToken(ListTablesResponse payload) {

@Override
public Iterable<Table> extractResources(ListTablesResponse payload) {
return payload.getTablesList();
return payload.getTablesList() != null
? payload.getTablesList()
: ImmutableList.<Table>of();
}
};

Expand Down Expand Up @@ -381,7 +383,9 @@ public String extractNextToken(ListSnapshotsResponse payload) {

@Override
public Iterable<Snapshot> extractResources(ListSnapshotsResponse payload) {
return payload.getSnapshotsList();
return payload.getSnapshotsList() != null
? payload.getSnapshotsList()
: ImmutableList.<Snapshot>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ public String extractNextToken(AcceleratorTypeAggregatedList payload) {
@Override
public Iterable<AcceleratorTypesScopedList> extractResources(
AcceleratorTypeAggregatedList payload) {
return payload.getItemsMap().values();
return payload.getItemsMap() != null
? payload.getItemsMap().values()
: ImmutableList.<AcceleratorTypesScopedList>of();
}
};

Expand Down Expand Up @@ -292,7 +294,9 @@ public String extractNextToken(AcceleratorTypeList payload) {

@Override
public Iterable<AcceleratorType> extractResources(AcceleratorTypeList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<AcceleratorType>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ public String extractNextToken(AddressAggregatedList payload) {

@Override
public Iterable<AddressesScopedList> extractResources(AddressAggregatedList payload) {
return payload.getItemsMap().values();
return payload.getItemsMap() != null
? payload.getItemsMap().values()
: ImmutableList.<AddressesScopedList>of();
}
};

Expand Down Expand Up @@ -294,7 +296,9 @@ public String extractNextToken(AddressList payload) {

@Override
public Iterable<Address> extractResources(AddressList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<Address>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ public String extractNextToken(AutoscalerAggregatedList payload) {
@Override
public Iterable<AutoscalersScopedList> extractResources(
AutoscalerAggregatedList payload) {
return payload.getItemsMap().values();
return payload.getItemsMap() != null
? payload.getItemsMap().values()
: ImmutableList.<AutoscalersScopedList>of();
}
};

Expand Down Expand Up @@ -314,7 +316,9 @@ public String extractNextToken(AutoscalerList payload) {

@Override
public Iterable<Autoscaler> extractResources(AutoscalerList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<Autoscaler>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ public String extractNextToken(BackendBucketList payload) {

@Override
public Iterable<BackendBucket> extractResources(BackendBucketList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<BackendBucket>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,9 @@ public String extractNextToken(BackendServiceAggregatedList payload) {
@Override
public Iterable<BackendServicesScopedList> extractResources(
BackendServiceAggregatedList payload) {
return payload.getItemsMap().values();
return payload.getItemsMap() != null
? payload.getItemsMap().values()
: ImmutableList.<BackendServicesScopedList>of();
}
};

Expand Down Expand Up @@ -375,7 +377,9 @@ public String extractNextToken(BackendServiceList payload) {

@Override
public Iterable<BackendService> extractResources(BackendServiceList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<BackendService>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ public String extractNextToken(DiskAggregatedList payload) {

@Override
public Iterable<DisksScopedList> extractResources(DiskAggregatedList payload) {
return payload.getItemsMap().values();
return payload.getItemsMap() != null
? payload.getItemsMap().values()
: ImmutableList.<DisksScopedList>of();
}
};

Expand Down Expand Up @@ -313,7 +315,9 @@ public String extractNextToken(DiskList payload) {

@Override
public Iterable<Disk> extractResources(DiskList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<Disk>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ public String extractNextToken(DiskTypeAggregatedList payload) {

@Override
public Iterable<DiskTypesScopedList> extractResources(DiskTypeAggregatedList payload) {
return payload.getItemsMap().values();
return payload.getItemsMap() != null
? payload.getItemsMap().values()
: ImmutableList.<DiskTypesScopedList>of();
}
};

Expand Down Expand Up @@ -278,7 +280,9 @@ public String extractNextToken(DiskTypeList payload) {

@Override
public Iterable<DiskType> extractResources(DiskTypeList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<DiskType>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ public String extractNextToken(FirewallList payload) {

@Override
public Iterable<Firewall> extractResources(FirewallList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<Firewall>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ public String extractNextToken(ForwardingRuleAggregatedList payload) {
@Override
public Iterable<ForwardingRulesScopedList> extractResources(
ForwardingRuleAggregatedList payload) {
return payload.getItemsMap().values();
return payload.getItemsMap() != null
? payload.getItemsMap().values()
: ImmutableList.<ForwardingRulesScopedList>of();
}
};

Expand Down Expand Up @@ -321,7 +323,9 @@ public String extractNextToken(ForwardingRuleList payload) {

@Override
public Iterable<ForwardingRule> extractResources(ForwardingRuleList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<ForwardingRule>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ public String extractNextToken(AddressList payload) {

@Override
public Iterable<Address> extractResources(AddressList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<Address>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,9 @@ public String extractNextToken(ForwardingRuleList payload) {

@Override
public Iterable<ForwardingRule> extractResources(ForwardingRuleList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<ForwardingRule>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ public String extractNextToken(OperationAggregatedList payload) {
@Override
public Iterable<OperationsScopedList> extractResources(
OperationAggregatedList payload) {
return payload.getItemsMap().values();
return payload.getItemsMap() != null
? payload.getItemsMap().values()
: ImmutableList.<OperationsScopedList>of();
}
};

Expand Down Expand Up @@ -298,7 +300,9 @@ public String extractNextToken(OperationList payload) {

@Override
public Iterable<Operation> extractResources(OperationList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<Operation>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ public String extractNextToken(HealthCheckList payload) {

@Override
public Iterable<HealthCheck> extractResources(HealthCheckList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<HealthCheck>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ public String extractNextToken(HttpHealthCheckList payload) {

@Override
public Iterable<HttpHealthCheck2> extractResources(HttpHealthCheckList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<HttpHealthCheck2>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ public String extractNextToken(HttpsHealthCheckList payload) {

@Override
public Iterable<HttpsHealthCheck2> extractResources(HttpsHealthCheckList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<HttpsHealthCheck2>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ public String extractNextToken(ImageList payload) {

@Override
public Iterable<Image> extractResources(ImageList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<Image>of();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ public String extractNextToken(InstanceGroupManagerAggregatedList payload) {
@Override
public Iterable<InstanceGroupManagersScopedList> extractResources(
InstanceGroupManagerAggregatedList payload) {
return payload.getItemsMap().values();
return payload.getItemsMap() != null
? payload.getItemsMap().values()
: ImmutableList.<InstanceGroupManagersScopedList>of();
}
};

Expand Down Expand Up @@ -411,7 +413,9 @@ public String extractNextToken(InstanceGroupManagerList payload) {
@Override
public Iterable<InstanceGroupManager> extractResources(
InstanceGroupManagerList payload) {
return payload.getItemsList();
return payload.getItemsList() != null
? payload.getItemsList()
: ImmutableList.<InstanceGroupManager>of();
}
};

Expand Down
Loading