code: public Observable<ServiceResponse<PolicyAssignmentInner>> createByIdWithServiceResponseAsync(String policyAssignmentId, PolicyAssignmentInner parameters) {
          if (policyAssignmentId == null) {
              throw new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.");
          }
          if (parameters == null) {
              throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
          }
          if (this.client.apiVersion() == null) {
              throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
          }
          Validator.validate(parameters);
          return service.createById(policyAssignmentId, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
              .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<PolicyAssignmentInner>>>() {
                  @Override
                  public Observable<ServiceResponse<PolicyAssignmentInner>> call(Response<ResponseBody> response) {
                      try {
                          ServiceResponse<PolicyAssignmentInner> clientResponse = createByIdDelegate(response);
                          return Observable.just(clientResponse);
                      } catch (Throwable t) {
                          return Observable.error(t);
                      }
                  }
              });
      }
docs: Creates a policy assignment by ID.
  Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
  
  @param policyAssignmentId The ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
  @param parameters Parameters for policy assignment.
  @throws IllegalArgumentException thrown if parameters fail the validation
  @return the observable to the PolicyAssignmentInner object