Skip to content

Commit

Permalink
Fix: Incorrect Syntax for Java
Browse files Browse the repository at this point in the history
  • Loading branch information
dgilling committed Oct 31, 2024
1 parent f5a2d7b commit 8d94c6d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
20 changes: 12 additions & 8 deletions source/includes/collector-api/_companies-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ apiClient.UpdateCompany(company);
```

```java
MoesifAPIClient apiClient = new MoesifAPIClient("YOUR_COLLECTOR_APPLICATION_ID").Api;
MoesifAPIClient client = new MoesifAPIClient("YOUR_COLLECTOR_APPLICATION_ID").Api;

// Only companyId is required
// metadata can be any custom object
Expand All @@ -253,10 +253,10 @@ CompanyModel company = new CompanyBuilder()
.build();

// Asynchronous Call to update company
apiClient.updateCompanyAsync(company, callBack);
client.getAPI().updateCompanyAsync(company, callBack);

// Synchronous Call to update company
apiClient.updateCompany(company, callBack);
client.getAPI().updateCompany(company, callBack);
```

```javascript--browser
Expand Down Expand Up @@ -636,7 +636,7 @@ apiClient.UpdateCompaniesBatch(companies);
```

```java
MoesifAPIClient apiClient = new MoesifAPIClient("YOUR_COLLECTOR_APPLICATION_ID").Api;
MoesifAPIClient client = new MoesifAPIClient("YOUR_COLLECTOR_APPLICATION_ID").Api;

// Only companyId is required
// metadata can be any custom object
Expand All @@ -655,11 +655,15 @@ CompanyModel company = new CompanyBuilder()
"}"))
.build();

// Asynchronous Call to update company
apiClient.updateCompanyAsync(company, callBack);
// Create a batch of companies
List<EventModel> events = new ArrayList<CompanyModel>();
events.add(company);

// Synchronous Call to update company
apiClient.updateCompany(company, callBack);
// Asynchronous Call to update companies
client.getAPI().updateCompaniesBatchAsync(companies, callBack);

// Synchronous Call to update companies
client.getAPI().updateCompaniesBatch(companies);
```

<blockquote class="lang-specific javascript--browser">
Expand Down
9 changes: 3 additions & 6 deletions source/includes/collector-api/_events-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ APICallBack<Object> callBack = new APICallBack<Object>() {
api.createEventAsync(eventModel, callBack);

// Synchronous call to Send Event to Moesif
api.createEvent(eventModel, callBack);
api.createEvent(eventModel);
```

```javascript--nodejs
Expand Down Expand Up @@ -311,8 +311,7 @@ event_rsp = EventResponseModel(time = datetime.utcnow(),
event_model = EventModel(request = event_req,
response = event_rsp,
user_id = "12345",
company_id = "67890",
= "XXXXXXXXX")
company_id = "67890")


# Perform the API call through the SDK function
Expand Down Expand Up @@ -383,7 +382,6 @@ event_model.request = event_req
event_model.response = event_rsp
event_model.user_id ="12345"
event_model.company_id ="67890"
event_model. = "XXXXXXXXX"

# Perform the API call through the SDK function
response = api.create_event(event_model)
Expand Down Expand Up @@ -620,7 +618,6 @@ $event->metadata = array(

$event->user_id = "12345";
$event->company_id = "67890";
$event-> = "XXXXXXXXX";

$api->createEvent($event);
```
Expand Down Expand Up @@ -819,7 +816,7 @@ events.add(eventModel);
api.createEventsBatchAsync(events, callBack);

// Synchronous Call to Send Event to Moesif
api.createEventsBatch(events, callBack);
api.createEventsBatch(events);
```

```javascript--nodejs
Expand Down
16 changes: 8 additions & 8 deletions source/includes/collector-api/_users-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ apiClient.UpdateUser(user);
```

```java
MoesifAPIClient apiClient = new MoesifAPIClient("YOUR_COLLECTOR_APPLICATION_ID");
MoesifAPIClient client = new MoesifAPIClient("YOUR_COLLECTOR_APPLICATION_ID");

// Only userId is required
// metadata can be any custom object
Expand All @@ -266,11 +266,11 @@ UserModel user = new UserBuilder()
"}"))
.build();

// Synchronous Call to update user
apiClient.updateUser(user);

// Asynchronous Call to update user
apiClient.updateUserAsync(user, callBack);
client.getAPI().updateUserAsync(user, callBack);

// Synchronous Call to update user
client.getAPI().updateUser(user);
```

```javascript--browser
Expand Down Expand Up @@ -673,7 +673,7 @@ apiClient.UpdateUsersBatch(users);
```

```java
MoesifAPIClient apiClient = new MoesifAPIClient("YOUR_COLLECTOR_APPLICATION_ID");
MoesifAPIClient client = new MoesifAPIClient("YOUR_COLLECTOR_APPLICATION_ID");

List<UserModel> users = new ArrayList<UserModel>();

Expand Down Expand Up @@ -723,11 +723,11 @@ APICallBack<Object> callBack = new APICallBack<Object>() {
};

// Asynchronous call to update users
apiClient.updateUsersBatchAsync(users, callBack);
client.getAPI().updateUsersBatchAsync(users, callBack);


// Synchronous call to update users
apiClient.updateUsersBatch(users, callBack);
client.getAPI().updateUsersBatch(users);
```

<blockquote class="lang-specific javascript--browser">
Expand Down

0 comments on commit 8d94c6d

Please sign in to comment.