patchProjectsBySlugWithHttpInfo method

Future<Response> patchProjectsBySlugWithHttpInfo(
  1. String slug,
  2. ProjectsUpdate projectsUpdate
)

Changes a project's settings, and only the settings you send.

Changes a project's settings, and only the settings you send. Every field is optional and absent means "leave it": name may not be blanked, framework must stay a known build hint, and cacheControl is capped at 256 characters with no newlines (it becomes a response header). visibility flips public/private under the same rule as create — public is free, private needs a funded org. upstream and license are free-text credit for third-party work, and sending "" clears one. Changing anything reconciles the project's canonical git repo, so a visibility change reaches the source and not just the listing. hidden/hiddenReason are platform MODERATION and are ignored unless the caller is a platform admin; they remove a project from the public catalogue without touching the publisher's own visibility choice, so un-hiding restores exactly what they asked for. Scope: a validated principal is required (403 without one) and the project is resolved within that principal's org, so another tenant's slug is a 404.

Note: This method returns the HTTP Response.

Parameters:

  • String slug (required): Slug is the project to update, from the path. The URL is the addressing authority — a slug in the body cannot move the write to another project.

  • ProjectsUpdate projectsUpdate (required):

Implementation

Future<Response> patchProjectsBySlugWithHttpInfo(String slug, ProjectsUpdate projectsUpdate,) async {
  // ignore: prefer_const_declarations
  final path = r'/v1/projects/{slug}'
    .replaceAll('{slug}', slug);

  // ignore: prefer_final_locals
  Object? postBody = projectsUpdate;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['application/json'];


  return apiClient.invokeAPI(
    path,
    'PATCH',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}