All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.larksuite.oapi.service.tenant.v2.TenantService Maven / Gradle / Ivy

Go to download

Larksuite open platform facilitates the integration of enterprise applications and larksuite, making collaboration and management more efficient

There is a newer version: 1.0.18-rc8
Show newest version
// Code generated by lark suite oapi sdk gen
package com.larksuite.oapi.service.tenant.v2;

import com.larksuite.oapi.core.api.AccessTokenType;
import com.larksuite.oapi.core.api.Api;
import com.larksuite.oapi.core.api.ReqCaller;
import com.larksuite.oapi.core.api.request.*;
import com.larksuite.oapi.core.api.response.*;
import com.larksuite.oapi.core.Config;
import com.larksuite.oapi.service.tenant.v2.model.*;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;

public class TenantService {

    private final Config config;
    private final Tenants tenants;

    public TenantService(Config config) {
        this.config = config;
        this.tenants = new Tenants(this);
    }

    public Tenants getTenants() {
        return tenants;
    }

    public static class Tenants {

        private final TenantService service;

        public Tenants(TenantService service) {
            this.service = service;
        }
    
        public TenantQueryReqCall query(RequestOptFn... optFns) {
            return new TenantQueryReqCall(this, optFns);
        }
    
    }
    public static class TenantQueryReqCall extends ReqCaller {
        private final Tenants tenants;
        
        private final List optFns;
        private TenantQueryResult result;
        
        private TenantQueryReqCall(Tenants tenants, RequestOptFn... optFns) {
        
            this.optFns = new ArrayList<>();
            this.optFns.addAll(Arrays.asList(optFns));
            this.result = new TenantQueryResult();
            this.tenants = tenants;
        }
        

        @Override
        public Response execute() throws Exception {
            com.larksuite.oapi.core.api.request.Request request = com.larksuite.oapi.core.api.request.Request.newRequest("/open-apis/tenant/v2/tenant/query", "GET",
                    new AccessTokenType[]{AccessTokenType.Tenant},
                    null, this.result, this.optFns.toArray(new RequestOptFn[]{}));
            return Api.send(this.tenants.service.config, request);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy