( projectRefOrParams: string | CreateEnvironmentVariableParams, slug?: string, params?: CreateEnvironmentVariableParams )
| 103 | params: CreateEnvironmentVariableParams |
| 104 | ): ApiPromise<EnvironmentVariableResponseBody>; |
| 105 | export function create( |
| 106 | projectRefOrParams: string | CreateEnvironmentVariableParams, |
| 107 | slug?: string, |
| 108 | params?: CreateEnvironmentVariableParams |
| 109 | ): ApiPromise<EnvironmentVariableResponseBody> { |
| 110 | let $projectRef: string; |
| 111 | let $slug: string; |
| 112 | let $params: CreateEnvironmentVariableParams; |
| 113 | |
| 114 | if (taskContext.ctx) { |
| 115 | if (typeof projectRefOrParams === "string") { |
| 116 | $projectRef = projectRefOrParams; |
| 117 | $slug = slug ?? taskContext.ctx.environment.slug; |
| 118 | |
| 119 | if (!params) { |
| 120 | throw new Error("params is required"); |
| 121 | } |
| 122 | |
| 123 | $params = params; |
| 124 | } else { |
| 125 | $params = projectRefOrParams; |
| 126 | $projectRef = taskContext.ctx.project.ref; |
| 127 | $slug = taskContext.ctx.environment.slug; |
| 128 | } |
| 129 | } else { |
| 130 | if (typeof projectRefOrParams !== "string") { |
| 131 | throw new Error("projectRef is required"); |
| 132 | } |
| 133 | |
| 134 | if (!slug) { |
| 135 | throw new Error("slug is required"); |
| 136 | } |
| 137 | |
| 138 | if (!params) { |
| 139 | throw new Error("params is required"); |
| 140 | } |
| 141 | |
| 142 | $projectRef = projectRefOrParams; |
| 143 | $slug = slug; |
| 144 | $params = params; |
| 145 | } |
| 146 | |
| 147 | const apiClient = apiClientManager.client; |
| 148 | |
| 149 | if (!apiClient) { |
| 150 | throw apiClientMissingError(); |
| 151 | } |
| 152 | |
| 153 | return apiClient.createEnvVar($projectRef, $slug, $params); |
| 154 | } |
| 155 | |
| 156 | export function retrieve( |
| 157 | projectRef: string, |
nothing calls this directly
no test coverage detected
searching dependent graphs…