Skip to content

Commit

Permalink
3.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SupportSDM committed Mar 28, 2023
1 parent 30a393f commit 0651527
Show file tree
Hide file tree
Showing 10 changed files with 4,453 additions and 12 deletions.
72 changes: 72 additions & 0 deletions com/strongdm/api/AccountResourceHistory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// Copyright 2020 StrongDM Inc
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

// Code generated by protogen. DO NOT EDIT.

package com.strongdm.api;

import java.util.Date;

/**
* AccountResourceHistory records the state of a AccountResource at a given point in time, where
* every change (create or delete) to a AccountResource produces an AccountResourceHistory record.
*/
public class AccountResourceHistory {
private AccountResource accountResource;
/** The complete AccountResource state at this time. */
public AccountResource getAccountResource() {
return this.accountResource;
}
/** The complete AccountResource state at this time. */
public void setAccountResource(AccountResource in) {
this.accountResource = in;
}

private String activityId;
/**
* The unique identifier of the Activity that produced this change to the AccountResource. May be
* empty for some system-initiated updates.
*/
public String getActivityId() {
return this.activityId;
}
/**
* The unique identifier of the Activity that produced this change to the AccountResource. May be
* empty for some system-initiated updates.
*/
public void setActivityId(String in) {
this.activityId = in;
}

private Date deletedAt;
/** If this AccountResource was deleted, the time it was deleted. */
public Date getDeletedAt() {
return this.deletedAt;
}
/** If this AccountResource was deleted, the time it was deleted. */
public void setDeletedAt(Date in) {
this.deletedAt = in;
}

private Date timestamp;
/** The time at which the AccountResource state was recorded. */
public Date getTimestamp() {
return this.timestamp;
}
/** The time at which the AccountResource state was recorded. */
public void setTimestamp(Date in) {
this.timestamp = in;
}
}
111 changes: 111 additions & 0 deletions com/strongdm/api/AccountResourcesHistory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
// Copyright 2020 StrongDM Inc
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

// Code generated by protogen. DO NOT EDIT.

package com.strongdm.api;

import com.strongdm.api.plumbing.AccountResourcesHistoryGrpc;
import com.strongdm.api.plumbing.AccountResourcesHistoryPlumbing;
import com.strongdm.api.plumbing.PageIterator;
import com.strongdm.api.plumbing.PageResult;
import com.strongdm.api.plumbing.Plumbing;
import com.strongdm.api.plumbing.Spec.ListRequestMetadata;
import io.grpc.ManagedChannel;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;

/** AccountResourcesHistory records all changes to the state of a AccountResource. */
public class AccountResourcesHistory {
private final AccountResourcesHistoryGrpc.AccountResourcesHistoryBlockingStub stub;
private final Client parent;

public AccountResourcesHistory(ManagedChannel channel, Client client) {

this.stub = AccountResourcesHistoryGrpc.newBlockingStub(channel);
this.parent = client;
}

private AccountResourcesHistory(
AccountResourcesHistoryGrpc.AccountResourcesHistoryBlockingStub stub, Client client) {
this.stub = stub;
this.parent = client;
}

/**
* This function returns a copy of the AccountResourcesHistory service which has the given
* deadline set for all method calls.
*/
public AccountResourcesHistory withDeadlineAfter(long duration, TimeUnit units) {
return new AccountResourcesHistory(this.stub.withDeadlineAfter(duration, units), this.parent);
}
/** List gets a list of AccountResourceHistory records matching a given set of criteria. */
public Iterable<AccountResourceHistory> list(String filter, Object... args) throws RpcException {
AccountResourcesHistoryPlumbing.AccountResourceHistoryListRequest.Builder builder =
AccountResourcesHistoryPlumbing.AccountResourceHistoryListRequest.newBuilder();
builder.setFilter(Plumbing.quoteFilterArgs(filter, args));
ListRequestMetadata.Builder metaBuilder = ListRequestMetadata.newBuilder();
Object pageSizeOption = this.parent.testOptions.get("PageSize");
if (pageSizeOption instanceof Integer) {
metaBuilder.setLimit((int) pageSizeOption);
}
if (this.parent.snapshotDate != null) {
metaBuilder.setSnapshotAt(Plumbing.convertTimestampToPlumbing(this.parent.snapshotDate));
}
builder.setMeta(metaBuilder);

Supplier<PageResult<AccountResourceHistory>> pageFetcher =
() -> {
// Note: this closure captures and reuses the builder to set the next page
AccountResourcesHistoryPlumbing.AccountResourceHistoryListRequest req = builder.build();
AccountResourcesHistoryPlumbing.AccountResourceHistoryListResponse plumbingResponse;
int tries = 0;
while (true) {
try {
plumbingResponse =
this.stub
.withCallCredentials(
this.parent.getCallCredentials("AccountResourcesHistory.List", req))
.list(req);
} catch (Exception e) {
if (this.parent.shouldRetry(tries, e)) {
tries++;
this.parent.jitterSleep(tries);
continue;
}
throw Plumbing.convertExceptionToPorcelain(e);
}
break;
}

List<AccountResourceHistory> page =
Plumbing.convertRepeatedAccountResourceHistoryToPorcelain(
plumbingResponse.getHistoryList());

boolean hasNextCursor = plumbingResponse.getMeta().getNextCursor() != "";
builder.setMeta(
ListRequestMetadata.newBuilder()
.setCursor(plumbingResponse.getMeta().getNextCursor()));

return new PageResult<AccountResourceHistory>(page, hasNextCursor);
};

Iterator<AccountResourceHistory> iterator = new PageIterator<>(pageFetcher);

return () -> iterator;
}
}
2 changes: 2 additions & 0 deletions com/strongdm/api/ActivityVerb.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ public final class ActivityVerb {
public static final String WORKFLOW_NOTIFICATION_OPTIONS_UPDATED =
"workflow notification settings updated";
public static final String ORG_VNM_SUBNET_UPDATED = "organization VNM subnet updated";
public static final String ORG_VNM_RESOURCES_ALLOCATED =
"organization resources allocated within VNM subnet";
public static final String DEPRECATED_ORG_ACTIVATE_DEVICE_APPROVAL = "activate device approval";
public static final String DEPRECATED_ORG_DEACTIVATE_DEVICE_APPROVAL =
"deactivate device approval";
Expand Down
9 changes: 9 additions & 0 deletions com/strongdm/api/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ public AccountResources accountResources() {
return this.accountResources;
}

protected final AccountResourcesHistory accountResourcesHistory;

/** AccountResourcesHistory records all changes to the state of a AccountResource. */
public AccountResourcesHistory accountResourcesHistory() {
return this.accountResourcesHistory;
}

protected final Accounts accounts;

/**
Expand Down Expand Up @@ -301,6 +308,7 @@ private Client(Client client) {
this.accountGrantsHistory = new AccountGrantsHistory(this.channel, this);
this.accountPermissions = new AccountPermissions(this.channel, this);
this.accountResources = new AccountResources(this.channel, this);
this.accountResourcesHistory = new AccountResourcesHistory(this.channel, this);
this.accounts = new Accounts(this.channel, this);
this.accountsHistory = new AccountsHistory(this.channel, this);
this.activities = new Activities(this.channel, this);
Expand Down Expand Up @@ -349,6 +357,7 @@ public Client(String apiAccessKey, String apiSecretKey, ClientOptions options)
this.accountGrantsHistory = new AccountGrantsHistory(this.channel, this);
this.accountPermissions = new AccountPermissions(this.channel, this);
this.accountResources = new AccountResources(this.channel, this);
this.accountResourcesHistory = new AccountResourcesHistory(this.channel, this);
this.accounts = new Accounts(this.channel, this);
this.accountsHistory = new AccountsHistory(this.channel, this);
this.activities = new Activities(this.channel, this);
Expand Down
2 changes: 1 addition & 1 deletion com/strongdm/api/SigningCallCredential.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SigningCallCredential extends CallCredentials {
private final String apiAccessKey;
private final String signature;
private static final String API_VERSION = "2021-08-23";
private static final String USER_AGENT = "strongdm-sdk-java/3.9.0";
private static final String USER_AGENT = "strongdm-sdk-java/3.10.0";

protected SigningCallCredential(String apiAccessKey, String signature) {
this.apiAccessKey = apiAccessKey;
Expand Down
Loading

0 comments on commit 0651527

Please sign in to comment.