code: private static BoxRetentionPolicy.Info createRetentionPolicy(BoxAPIConnection api, String name, String type,
                                                                   int length, String action,
                                                                   RetentionPolicyParams optionalParams) {
          URL url = RETENTION_POLICIES_URL_TEMPLATE.build(api.getBaseURL());
          BoxJSONRequest request = new BoxJSONRequest(api, url, "POST");
          JsonObject requestJSON = new JsonObject()
                  .add("policy_name", name)
                  .add("policy_type", type)
                  .add("disposition_action", action);
          if (!type.equals(TYPE_INDEFINITE)) {
              requestJSON.add("retention_length", length);
          }
          if (optionalParams != null) {
              requestJSON.add("can_owner_extend_retention", optionalParams.getCanOwnerExtendRetention());
              requestJSON.add("are_owners_notified", optionalParams.getAreOwnersNotified());
  
              List<BoxUser.Info> customNotificationRecipients = optionalParams.getCustomNotificationRecipients();
              if (customNotificationRecipients.size() > 0) {
                  JsonArray users = new JsonArray();
                  for (BoxUser.Info user : customNotificationRecipients) {
                      JsonObject userJSON = new JsonObject()
                              .add("type", "user")
                              .add("id", user.getID());
                      users.add(userJSON);
                  }
                  requestJSON.add("custom_notification_recipients", users);
              }
          }
          request.setBody(requestJSON.toString());
          BoxJSONResponse response = (BoxJSONResponse) request.send();
          JsonObject responseJSON = JsonObject.readFrom(response.getJSON());
          BoxRetentionPolicy createdPolicy = new BoxRetentionPolicy(api, responseJSON.get("id").asString());
          return createdPolicy.new Info(responseJSON);
      }
docs: Used to create a new retention policy with optional parameters.
  @param api the API connection to be used by the created user.
  @param name the name of the retention policy.
  @param type the type of the retention policy. Can be "finite" or "indefinite".
  @param length the duration in days that the retention policy will be active for after being assigned to content.
  @param action the disposition action can be "permanently_delete" or "remove_retention".
  @param optionalParams the optional parameters.
  @return the created retention policy's info.