Skip to content

Latest commit

 

History

History
385 lines (297 loc) · 21.1 KB

README.md

File metadata and controls

385 lines (297 loc) · 21.1 KB

SharedLinks

(fileStorage().sharedLinks())

Overview

Available Operations

  • list - List SharedLinks
  • create - Create Shared Link
  • get - Get Shared Link
  • update - Update Shared Link
  • delete - Delete Shared Link

list

List SharedLinks

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.FileStorageSharedLinksAllRequest;
import com.apideck.unify.models.operations.FileStorageSharedLinksAllResponse;
import java.lang.Exception;
import java.util.Map;

public class Application {

    public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {

        Apideck sdk = Apideck.builder()
                .apiKey("<YOUR_API_KEY_HERE>")
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
            .build();

        FileStorageSharedLinksAllRequest req = FileStorageSharedLinksAllRequest.builder()
                .serviceId("salesforce")
                .passThrough(Map.ofEntries(
                    Map.entry("search", "San Francisco")))
                .fields("id,updated_at")
                .build();

        FileStorageSharedLinksAllResponse res = sdk.fileStorage().sharedLinks().list()
                .request(req)
                .call();

        if (res.getSharedLinksResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request FileStorageSharedLinksAllRequest ✔️ The request object to use for the request.

Response

FileStorageSharedLinksAllResponse

Errors

Error Type Status Code Content Type
models/errors/BadRequestResponse 400 application/json
models/errors/UnauthorizedResponse 401 application/json
models/errors/PaymentRequiredResponse 402 application/json
models/errors/NotFoundResponse 404 application/json
models/errors/UnprocessableResponse 422 application/json
models/errors/APIException 4XX, 5XX */*

create

Create Shared Link

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.ExtendPaths;
import com.apideck.unify.models.components.PassThroughBody;
import com.apideck.unify.models.components.Scope;
import com.apideck.unify.models.components.SharedLinkInput;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.FileStorageSharedLinksAddRequest;
import com.apideck.unify.models.operations.FileStorageSharedLinksAddResponse;
import java.lang.Exception;
import java.util.List;
import java.util.Map;

public class Application {

    public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {

        Apideck sdk = Apideck.builder()
                .apiKey("<YOUR_API_KEY_HERE>")
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
            .build();

        FileStorageSharedLinksAddRequest req = FileStorageSharedLinksAddRequest.builder()
                .sharedLink(SharedLinkInput.builder()
                    .targetId("<id>")
                    .downloadUrl("https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg")
                    .scope(Scope.COMPANY)
                    .passThrough(List.of(
                        PassThroughBody.builder()
                            .serviceId("<id>")
                            .extendPaths(List.of(
                                ExtendPaths.builder()
                                    .path("$.nested.property")
                                    .value(Map.ofEntries(\n    Map.entry("TaxClassificationRef", Map.ofEntries(\n    Map.entry("value", "EUC-99990201-V1-00020000")))))
                                    .build()))
                            .build()))
                    .build())
                .serviceId("salesforce")
                .build();

        FileStorageSharedLinksAddResponse res = sdk.fileStorage().sharedLinks().create()
                .request(req)
                .call();

        if (res.createSharedLinkResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request FileStorageSharedLinksAddRequest ✔️ The request object to use for the request.

Response

FileStorageSharedLinksAddResponse

Errors

Error Type Status Code Content Type
models/errors/BadRequestResponse 400 application/json
models/errors/UnauthorizedResponse 401 application/json
models/errors/PaymentRequiredResponse 402 application/json
models/errors/NotFoundResponse 404 application/json
models/errors/UnprocessableResponse 422 application/json
models/errors/APIException 4XX, 5XX */*

get

Get Shared Link

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.FileStorageSharedLinksOneRequest;
import com.apideck.unify.models.operations.FileStorageSharedLinksOneResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {

        Apideck sdk = Apideck.builder()
                .apiKey("<YOUR_API_KEY_HERE>")
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
            .build();

        FileStorageSharedLinksOneRequest req = FileStorageSharedLinksOneRequest.builder()
                .id("<id>")
                .serviceId("salesforce")
                .fields("id,updated_at")
                .build();

        FileStorageSharedLinksOneResponse res = sdk.fileStorage().sharedLinks().get()
                .request(req)
                .call();

        if (res.getSharedLinkResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request FileStorageSharedLinksOneRequest ✔️ The request object to use for the request.

Response

FileStorageSharedLinksOneResponse

Errors

Error Type Status Code Content Type
models/errors/BadRequestResponse 400 application/json
models/errors/UnauthorizedResponse 401 application/json
models/errors/PaymentRequiredResponse 402 application/json
models/errors/NotFoundResponse 404 application/json
models/errors/UnprocessableResponse 422 application/json
models/errors/APIException 4XX, 5XX */*

update

Update Shared Link

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.ExtendPaths;
import com.apideck.unify.models.components.PassThroughBody;
import com.apideck.unify.models.components.Scope;
import com.apideck.unify.models.components.SharedLinkInput;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.FileStorageSharedLinksUpdateRequest;
import com.apideck.unify.models.operations.FileStorageSharedLinksUpdateResponse;
import java.lang.Exception;
import java.util.List;
import java.util.Map;

public class Application {

    public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {

        Apideck sdk = Apideck.builder()
                .apiKey("<YOUR_API_KEY_HERE>")
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
            .build();

        FileStorageSharedLinksUpdateRequest req = FileStorageSharedLinksUpdateRequest.builder()
                .id("<id>")
                .sharedLink(SharedLinkInput.builder()
                    .targetId("<id>")
                    .downloadUrl("https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg")
                    .scope(Scope.COMPANY)
                    .passThrough(List.of(
                        PassThroughBody.builder()
                            .serviceId("<id>")
                            .extendPaths(List.of(
                                ExtendPaths.builder()
                                    .path("$.nested.property")
                                    .value(Map.ofEntries(\n    Map.entry("TaxClassificationRef", Map.ofEntries(\n    Map.entry("value", "EUC-99990201-V1-00020000")))))
                                    .build()))
                            .build()))
                    .build())
                .serviceId("salesforce")
                .build();

        FileStorageSharedLinksUpdateResponse res = sdk.fileStorage().sharedLinks().update()
                .request(req)
                .call();

        if (res.updateSharedLinkResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request FileStorageSharedLinksUpdateRequest ✔️ The request object to use for the request.

Response

FileStorageSharedLinksUpdateResponse

Errors

Error Type Status Code Content Type
models/errors/BadRequestResponse 400 application/json
models/errors/UnauthorizedResponse 401 application/json
models/errors/PaymentRequiredResponse 402 application/json
models/errors/NotFoundResponse 404 application/json
models/errors/UnprocessableResponse 422 application/json
models/errors/APIException 4XX, 5XX */*

delete

Delete Shared Link

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.FileStorageSharedLinksDeleteRequest;
import com.apideck.unify.models.operations.FileStorageSharedLinksDeleteResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {

        Apideck sdk = Apideck.builder()
                .apiKey("<YOUR_API_KEY_HERE>")
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
            .build();

        FileStorageSharedLinksDeleteRequest req = FileStorageSharedLinksDeleteRequest.builder()
                .id("<id>")
                .serviceId("salesforce")
                .build();

        FileStorageSharedLinksDeleteResponse res = sdk.fileStorage().sharedLinks().delete()
                .request(req)
                .call();

        if (res.deleteSharedLinkResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request FileStorageSharedLinksDeleteRequest ✔️ The request object to use for the request.

Response

FileStorageSharedLinksDeleteResponse

Errors

Error Type Status Code Content Type
models/errors/BadRequestResponse 400 application/json
models/errors/UnauthorizedResponse 401 application/json
models/errors/PaymentRequiredResponse 402 application/json
models/errors/NotFoundResponse 404 application/json
models/errors/UnprocessableResponse 422 application/json
models/errors/APIException 4XX, 5XX */*