Skip to content

Commit

Permalink
Merge pull request #155 from paulsmelser/release/minor/152/service_re…
Browse files Browse the repository at this point in the history
…quest_operations

#154 creating ServiceRequestOperations
  • Loading branch information
paulsmelser authored Feb 8, 2018
2 parents 893db22 + 5955c3d commit 80f23e2
Show file tree
Hide file tree
Showing 11 changed files with 338 additions and 29 deletions.
118 changes: 118 additions & 0 deletions API-implementation-tracking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@

## Customer Operations
~~Assign licenses to a user~~<br />
~~Get licenses assigned to a user~~<br />
Get licenses assigned to a user by license group<br />
~~Create a customer~~<br />
Create a customer for an indirect reseller<br />
Create user accounts for a customer<br />
Delete a user account for a customer<br />
Get a list of customers filtered by a search field<br />
Get a customer by ID<br />
~~Get a customer's billing profile~~<br />
Get a customer's company profile<br />
Get a customer's orders<br />
Get a customer's subscriptions<br />
Get a list of all user accounts for a customer<br />
Get a list of available licenses<br />
Get a list of available licenses by license group<br />
Get a list of customers<br />
Get a user account by ID<br />
Get user roles for a customer<br />
Remove a customer user from a role<br />
Retrieve a relationship request URL<br />
Reset user password for a customer<br />
Restore a deleted user for a customer<br />
Set user roles for a customer<br />
Update a customer's billing profile<br />
Update the nickname for a subscription<br />
Update user accounts for a customer<br />
View deleted users for a customer<br />

## Order Operations
Change the quantity of a subscription<br />
[Convert a trial subscription to paid](convert-a-trial-subscription-to-paid.md<br />
Create an order<br />
Create an order for a customer of an indirect reseller<br />
Get a list of add-ons for a subscription<br />
Get a list of offer categories by market<br />
Get a list of offers for a market<br />
Get a list of subscriptions by order<br />
Get a list of trial conversion offers<br />
Get a subscription by ID<br />
Get add-ons for an offer ID<br />
Get an offer by ID<br />
Get an order by ID<br />
Get subscription provisioning status<br />
Purchase an add-on to a subscription<br />
Reactivate a suspended subscription<br />
Remove a reseller relationship with a customer<br />
Suspend a subscription<br />
Transition a subscription<br />

## Audit Operations
Get a record of Partner Center activity

## Analytics Operations
Get partner licenses deployment information<br />
Get partner licenses usage information<br />
Get customer licenses deployment information<br />
Get customer licenses usage information<br />

## Billing Operations
Get a customer's service costs summary<br />
Get a customer's service costs line items<br />
Get a collection of invoices<br />
Get a customer's utilization records for Azure<br />
Get an invoice by ID<br />
Get invoice line items<br />
Get prices for Microsoft Azure<br />
Get prices for Microsoft Azure Partner Shared Services<br />
Get the partner's current account balance<br />
Get usage data for a subscription<br />
Get a usage summary for all of a customer's subscriptions<br />

## Support Operations
Create a service request<br />
Get a subscription's support contact<br />
Get all service requests for a customer<br />
Get service request support topics<br />
Get the managed services for a customer by ID<br />
Update a service request<br />
Update a subscription's support contact<br />

## Accounts and Profile Operations
Get a customer's subscriptions by partner MPN ID<br />
Get an organization profile<br />
Get customers of an indirect reseller<br />
Get indirect resellers of a customer<br />
Get Microsoft Partner Network profile<br />
Get partner billing profile<br />
Verify a partner MPN ID<br />
Get support profile<br />
Get the partner legal business profile<br />
Retrieve a list of indirect resellers<br />
Update an organization profile<br />
Update the partner billing profile<br />
Update support profile<br />
Update the partner legal business profile<br />

## Utility Operations
Validate an address<br />
Get address formatting rules by market<br />
Verify domain availability<br />
Delete a customer account from the integration sandbox<br />

## Device Deployment Operations
Create a new configuration policy for the specified customer<br />
Delete a configuration policy for the specified customer<br />
Get a list of a customer's policies<br />
Retrieve a customer's configuration policy<br />
Update a configuration policy for the specified customer<br />
Get the status of a device batch upload<br />
Get a list of device batches for the specified customer<br />
Get a list of devices for the specified batch and customer<br />
Upload a list of devices to create a new batch for the specified customer<br />
Upload a list of devices to an existing batch for the specified customer<br />
Update a list of devices with a policy<br />
Delete a device for the specified customer<br />
4 changes: 4 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes: Spring Social for Microsoft Partner Center

## 6.2.0
#### Added
1. ServiceRequestOperations added to allow for creating and retrieving service requests through the API

## 6.1.0

#### Bug Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ public interface AdminCustomerOperations extends CustomerOperations{
ResponseEntity<CustomerBillingProfile> getBillingProfile(String customerTenantId);
ResponseEntity<CustomerBillingProfile> updateBillingProfile(String customerTenantId, String etag, CustomerBillingProfile billingProfile);
ResponseEntity<PartnerCenterResponse<Customer>> getCompanyByDomain(int size, String filter);
ResponseEntity<PartnerCenterResponse<SubscribedSku>> subscribedSkus(String customerTenantId);
ResponseEntity<PartnerCenterResponse<SubscribedSku>> subscribedSkus(String customerId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,21 @@ public interface AdminUserOperations extends UserOperations{
ResponseEntity<PartnerCenterResponse<Role>> getUserRoles(String customerTenantId, String userId);
ResponseEntity<PartnerCenterResponse<Role>> getAllRoles(String customerTenantId);
ResponseEntity<PartnerCenterResponse<Role>> getRolesByRoleId(String customerTenantId, String RoleId);

/**
* Gets a list of deleted CustomerUser resources for a customer by customer ID.
*
* @param customerId The value is a GUID formatted customer-id that identifies the customer.
* @return List of deleted CustomerUsers
*/
ResponseEntity<PartnerCenterResponse<CustomerUser>> getDeletedUsers(String customerId);

/**
* Gets a list of deleted CustomerUser resources for a customer by customer ID.
*
* @param customerId The value is a GUID formatted customer-id that identifies the customer.
* @param size The maximum size of the list to be returned
* @return List of deleted CustomerUsers
*/
ResponseEntity<PartnerCenterResponse<CustomerUser>> getDeletedUsers(String customerId, Integer size);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package org.springframework.social.partnercenter.api.customer.user.impl;

import static org.springframework.social.partnercenter.serialization.Json.toJson;

import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.ResponseEntity;
import org.springframework.social.partnercenter.PartnerCenterAdmin;
import org.springframework.social.partnercenter.api.PartnerCenterResponse;
import org.springframework.social.partnercenter.api.customer.Role;
import org.springframework.social.partnercenter.api.customer.query.Filter;
import org.springframework.social.partnercenter.api.customer.query.Operator;
import org.springframework.social.partnercenter.api.customer.user.AdminUserOperations;
import org.springframework.social.partnercenter.api.customer.user.CustomerUser;
import org.springframework.social.partnercenter.api.customer.user.License;
Expand Down Expand Up @@ -108,6 +112,23 @@ public ResponseEntity<PartnerCenterResponse<Role>> getRolesByRoleId(String custo
.get(new ParameterizedTypeReference<PartnerCenterResponse<Role>>() {});
}

@Override
public ResponseEntity<PartnerCenterResponse<CustomerUser>> getDeletedUsers(String customerId) {
return restResource.request()
.pathSegment(customerId, "users")
.queryParam("filter", toJson(Filter.builder().field("UserState").operator(Operator.EQUALS).value("Inactive").build()))
.get(new ParameterizedTypeReference<PartnerCenterResponse<CustomerUser>>() {});
}

@Override
public ResponseEntity<PartnerCenterResponse<CustomerUser>> getDeletedUsers(String customerId, Integer size) {
return restResource.request()
.pathSegment(customerId, "users")
.queryParam("size", size)
.queryParam("filter", toJson(Filter.builder().field("UserState").operator(Operator.EQUALS).value("Inactive").build()))
.get(new ParameterizedTypeReference<PartnerCenterResponse<CustomerUser>>() {});
}

@Override
protected String getProviderId() {
return PartnerCenterAdmin.PROVIDER_ID;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.springframework.social.partnercenter.api.support;

import java.util.Locale;

import org.springframework.http.ResponseEntity;
import org.springframework.social.partnercenter.api.PartnerCenterResponse;
import org.springframework.social.partnercenter.api.support.managedservice.ManagedService;
Expand All @@ -12,5 +14,5 @@ public interface SupportOperations {
ResponseEntity<PartnerCenterResponse<SupportTopic>> getSupportTopics();
ResponseEntity<PartnerCenterResponse<ServiceRequest>> getServiceRequests(String customerId);
ResponseEntity<ServiceRequest> updateServiceRequest(ServiceRequest request);
ResponseEntity<ServiceRequest> createServiceRequest(ServiceRequest request);
ResponseEntity<ServiceRequest> createServiceRequest(ServiceRequest request, Locale locale);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.springframework.social.partnercenter.api.support.impl;

import java.util.Locale;

import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.ResponseEntity;
import org.springframework.social.partnercenter.PartnerCenter;
Expand Down Expand Up @@ -69,9 +71,9 @@ public ResponseEntity<ServiceRequest> updateServiceRequest(ServiceRequest reques
}

@Override
public ResponseEntity<ServiceRequest> createServiceRequest(ServiceRequest request) {
public ResponseEntity<ServiceRequest> createServiceRequest(ServiceRequest request, Locale locale) {
return restResource.request()
.pathSegment(SERVICE_REQUESTS)
.pathSegment(SERVICE_REQUESTS, locale.toLanguageTag())
.post(request, ServiceRequest.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
public class ServiceRequest {
private String id;
private String title;
private String description;
private String supportTopicId;
private String supportTopicName;
private ServiceRequestSeverity severity;
private ServiceRequestStatus status;
private ServiceRequestOrganization organization;
Expand All @@ -29,6 +32,9 @@ public class ServiceRequest {
private String countryCode;
private ResourceAttributes attributes;

public ServiceRequest() {
}

public String getTitle() {
return title;
}
Expand Down Expand Up @@ -164,4 +170,117 @@ public String getCountryCode() {
public void setCountryCode(String countryCode) {
this.countryCode = countryCode;
}

public static Builder builder() {
return new Builder();
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public String getSupportTopicId() {
return supportTopicId;
}

public void setSupportTopicId(String supportTopicId) {
this.supportTopicId = supportTopicId;
}

public String getSupportTopicName() {
return supportTopicName;
}

public void setSupportTopicName(String supportTopicName) {
this.supportTopicName = supportTopicName;
}

public static class Builder {
private String title;
private String description;
private ServiceRequestSeverity severity;
private ServiceRequestOrganization organization;
private ServiceRequestContact primaryContact;
private String supportTopicId;
private String supportTopicName;
private String productName;
private String productId;
private ServiceRequestNote newNote;
private String countryCode;

public Builder title(String title) {
this.title = title;
return this;
}

public Builder severity(ServiceRequestSeverity severity) {
this.severity = severity;
return this;
}

public Builder organization(ServiceRequestOrganization organization) {
this.organization = organization;
return this;
}

public Builder primaryContact(ServiceRequestContact primaryContact) {
this.primaryContact = primaryContact;
return this;
}

public Builder productName(String productName) {
this.productName = productName;
return this;
}

public Builder productId(String productId) {
this.productId = productId;
return this;
}

public Builder newNote(ServiceRequestNote newNote) {
this.newNote = newNote;
return this;
}

public Builder countryCode(String countryCode) {
this.countryCode = countryCode;
return this;
}

public Builder description(String description) {
this.description = description;
return this;
}

public ServiceRequest build() {
ServiceRequest request = new ServiceRequest();
request.setTitle(title);
request.setCountryCode(countryCode);
request.setSeverity(severity);
request.setOrganization(organization);
request.setPrimaryContact(primaryContact);
request.setProductName(productName);
request.setProductId(productId);
request.setNewNote(newNote);
request.setSupportTopicId(supportTopicId);
request.setSupportTopicName(supportTopicName);
request.setDescription(description);
return request;
}

public Builder supportTopicId(String supportTopicId) {
this.supportTopicId = supportTopicId;
return this;
}

public Builder supportTopicName(String supportTopicName) {
this.supportTopicName = supportTopicName;
return this;
}
}
}
Loading

0 comments on commit 80f23e2

Please sign in to comment.