Skip to content

Commit

Permalink
feat: update api
Browse files Browse the repository at this point in the history
  • Loading branch information
maemual committed Sep 9, 2024
1 parent 8e7801e commit 70ae412
Show file tree
Hide file tree
Showing 1,249 changed files with 59,708 additions and 54,967 deletions.
73 changes: 37 additions & 36 deletions lark_oapi/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
from . import tenant
from . import translation
from . import compensation
from . import ehr
from . import task
from . import block
from . import okr
from . import report
from . import document_ai
from . import docx
from . import drive
from . import hire
from . import mdm
from . import attendance
from . import bitable
from . import corehr
from . import personal_settings
from . import wiki
from . import vc
from . import acs
from . import drive
from . import im
from . import lingo
from . import passport
from . import search
from . import moments
from . import report
from . import security_and_compliance
from . import sheets
from . import aily
from . import baike
from . import optical_char_recognition
from . import admin
from . import wiki
from . import speech_to_text
from . import workplace
from . import calendar
from . import helpdesk
from . import lingo
from . import mail
from . import board
from . import gray_test_open_sg
from . import human_authentication
from . import search
from . import task
from . import tenant
from . import application
from . import compensation
from . import authen
from . import attendance
from . import baike
from . import calendar
from . import meeting_room
from . import personal_settings
from . import verification
from . import admin
from . import acs
from . import document_ai
from . import okr
from . import translation
from . import board
from . import corehr
from . import optical_char_recognition
from . import passport
from . import contact
from . import approval
from . import auth
from . import authen
from . import ehr
from . import human_authentication
from . import aily
from . import docx
from . import event
from . import security_and_compliance
from . import application
from . import approval
from . import contact
from . import gray_test_open_sg
from . import hire
from . import mdm
from . import vc
from . import workplace
from . import block
5 changes: 5 additions & 0 deletions lark_oapi/api/application/v6/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
from .check_white_black_list_application_visibility_request import *
from .patch_application_visibility_request_body import *
from .patch_application_visibility_request import *
from .apply_scope_request import *
from .list_scope_request import *
from .set_app_badge_response import *
from .list_app_recommend_rule_response_body import *
from .list_app_recommend_rule_response import *
Expand Down Expand Up @@ -137,6 +139,9 @@
from .check_white_black_list_application_visibility_response_body import *
from .check_white_black_list_application_visibility_response import *
from .patch_application_visibility_response import *
from .apply_scope_response import *
from .list_scope_response_body import *
from .list_scope_response import *
from .p2_application_application_created_v6 import *
from .p2_application_application_app_version_audit_v6 import *
from .p2_application_application_app_version_publish_apply_v6 import *
Expand Down
27 changes: 27 additions & 0 deletions lark_oapi/api/application/v6/model/apply_scope_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.model import BaseRequest
from lark_oapi.core.enum import HttpMethod, AccessTokenType


class ApplyScopeRequest(BaseRequest):
def __init__(self) -> None:
super().__init__()

@staticmethod
def builder() -> "ApplyScopeRequestBuilder":
return ApplyScopeRequestBuilder()


class ApplyScopeRequestBuilder(object):

def __init__(self) -> None:
apply_scope_request = ApplyScopeRequest()
apply_scope_request.http_method = HttpMethod.POST
apply_scope_request.uri = "/open-apis/application/v6/scopes/apply"
apply_scope_request.token_types = {AccessTokenType.TENANT}
self._apply_scope_request: ApplyScopeRequest = apply_scope_request

def build(self) -> ApplyScopeRequest:
return self._apply_scope_request
16 changes: 16 additions & 0 deletions lark_oapi/api/application/v6/model/apply_scope_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
from lark_oapi.core.model import BaseResponse


class ApplyScopeResponse(BaseResponse):
_types = {

}

def __init__(self, d=None):
super().__init__(d)

init(self, d, self._types)
27 changes: 27 additions & 0 deletions lark_oapi/api/application/v6/model/list_scope_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.model import BaseRequest
from lark_oapi.core.enum import HttpMethod, AccessTokenType


class ListScopeRequest(BaseRequest):
def __init__(self) -> None:
super().__init__()

@staticmethod
def builder() -> "ListScopeRequestBuilder":
return ListScopeRequestBuilder()


class ListScopeRequestBuilder(object):

def __init__(self) -> None:
list_scope_request = ListScopeRequest()
list_scope_request.http_method = HttpMethod.GET
list_scope_request.uri = "/open-apis/application/v6/scopes"
list_scope_request.token_types = {AccessTokenType.TENANT}
self._list_scope_request: ListScopeRequest = list_scope_request

def build(self) -> ListScopeRequest:
return self._list_scope_request
17 changes: 17 additions & 0 deletions lark_oapi/api/application/v6/model/list_scope_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
from lark_oapi.core.model import BaseResponse
from .list_scope_response_body import ListScopeResponseBody


class ListScopeResponse(BaseResponse):
_types = {
"data": ListScopeResponseBody
}

def __init__(self, d=None):
super().__init__(d)
self.data: Optional[ListScopeResponseBody] = None
init(self, d, self._types)
31 changes: 31 additions & 0 deletions lark_oapi/api/application/v6/model/list_scope_response_body.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
from .scope import Scope


class ListScopeResponseBody(object):
_types = {
"scopes": List[Scope],
}

def __init__(self, d=None):
self.scopes: Optional[List[Scope]] = None
init(self, d, self._types)

@staticmethod
def builder() -> "ListScopeResponseBodyBuilder":
return ListScopeResponseBodyBuilder()


class ListScopeResponseBodyBuilder(object):
def __init__(self) -> None:
self._list_scope_response_body = ListScopeResponseBody()

def scopes(self, scopes: List[Scope]) -> "ListScopeResponseBodyBuilder":
self._list_scope_response_body.scopes = scopes
return self

def build(self) -> "ListScopeResponseBody":
return self._list_scope_response_body
6 changes: 6 additions & 0 deletions lark_oapi/api/application/v6/model/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ class Scope(object):
_types = {
"scope_name": str,
"grant_status": int,
"scope_type": str,
}

def __init__(self, d=None):
self.scope_name: Optional[str] = None
self.grant_status: Optional[int] = None
self.scope_type: Optional[str] = None
init(self, d, self._types)

@staticmethod
Expand All @@ -32,5 +34,9 @@ def grant_status(self, grant_status: int) -> "ScopeBuilder":
self._scope.grant_status = grant_status
return self

def scope_type(self, scope_type: str) -> "ScopeBuilder":
self._scope.scope_type = scope_type
return self

def build(self) -> "Scope":
return self._scope
1 change: 1 addition & 0 deletions lark_oapi/api/application/v6/resource/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
from .application_management import *
from .application_visibility import *
from .bot import *
from .scope import *
92 changes: 92 additions & 0 deletions lark_oapi/api/application/v6/resource/scope.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Code generated by Lark OpenAPI.

import io
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.const import UTF_8, CONTENT_TYPE, APPLICATION_JSON
from lark_oapi.core import JSON
from lark_oapi.core.token import verify
from lark_oapi.core.http import Transport
from lark_oapi.core.model import Config, RequestOption, RawResponse
from lark_oapi.core.utils import Files
from requests_toolbelt import MultipartEncoder
from ..model.apply_scope_request import ApplyScopeRequest
from ..model.apply_scope_response import ApplyScopeResponse
from ..model.list_scope_request import ListScopeRequest
from ..model.list_scope_response import ListScopeResponse


class Scope(object):
def __init__(self, config: Config) -> None:
self.config: Config = config

def apply(self, request: ApplyScopeRequest, option: Optional[RequestOption] = None) -> ApplyScopeResponse:
if option is None:
option = RequestOption()

# 鉴权、获取 token
verify(self.config, request, option)

# 添加 content-type
if request.body is not None:
option.headers[CONTENT_TYPE] = f"{APPLICATION_JSON}; charset=utf-8"

# 发起请求
resp: RawResponse = Transport.execute(self.config, request, option)

# 反序列化
response: ApplyScopeResponse = JSON.unmarshal(str(resp.content, UTF_8), ApplyScopeResponse)
response.raw = resp

return response

async def aapply(self, request: ApplyScopeRequest, option: Optional[RequestOption] = None) -> ApplyScopeResponse:
if option is None:
option = RequestOption()

# 鉴权、获取 token
verify(self.config, request, option)

# 发起请求
resp: RawResponse = await Transport.aexecute(self.config, request, option)

# 反序列化
response: ApplyScopeResponse = JSON.unmarshal(str(resp.content, UTF_8), ApplyScopeResponse)
response.raw = resp

return response

def list(self, request: ListScopeRequest, option: Optional[RequestOption] = None) -> ListScopeResponse:
if option is None:
option = RequestOption()

# 鉴权、获取 token
verify(self.config, request, option)

# 添加 content-type
if request.body is not None:
option.headers[CONTENT_TYPE] = f"{APPLICATION_JSON}; charset=utf-8"

# 发起请求
resp: RawResponse = Transport.execute(self.config, request, option)

# 反序列化
response: ListScopeResponse = JSON.unmarshal(str(resp.content, UTF_8), ListScopeResponse)
response.raw = resp

return response

async def alist(self, request: ListScopeRequest, option: Optional[RequestOption] = None) -> ListScopeResponse:
if option is None:
option = RequestOption()

# 鉴权、获取 token
verify(self.config, request, option)

# 发起请求
resp: RawResponse = await Transport.aexecute(self.config, request, option)

# 反序列化
response: ListScopeResponse = JSON.unmarshal(str(resp.content, UTF_8), ListScopeResponse)
response.raw = resp

return response
1 change: 1 addition & 0 deletions lark_oapi/api/application/v6/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ def __init__(self, config: Config) -> None:
self.application_management: ApplicationManagement = ApplicationManagement(config)
self.application_visibility: ApplicationVisibility = ApplicationVisibility(config)
self.bot: Bot = Bot(config)
self.scope: Scope = Scope(config)
6 changes: 6 additions & 0 deletions lark_oapi/api/attendance/v1/model/create_shift_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
class CreateShiftRequest(BaseRequest):
def __init__(self) -> None:
super().__init__()
self.employee_type: Optional[str] = None
self.request_body: Optional[Shift] = None

@staticmethod
Expand All @@ -25,6 +26,11 @@ def __init__(self) -> None:
create_shift_request.token_types = {AccessTokenType.TENANT}
self._create_shift_request: CreateShiftRequest = create_shift_request

def employee_type(self, employee_type: str) -> "CreateShiftRequestBuilder":
self._create_shift_request.employee_type = employee_type
self._create_shift_request.add_query("employee_type", employee_type)
return self

def request_body(self, request_body: Shift) -> "CreateShiftRequestBuilder":
self._create_shift_request.request_body = request_body
self._create_shift_request.body = request_body
Expand Down
6 changes: 6 additions & 0 deletions lark_oapi/api/attendance/v1/model/user_daily_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class UserDailyShift(object):
"month": int,
"user_id": str,
"day_no": int,
"is_clear_schedule": bool,
}

def __init__(self, d=None):
Expand All @@ -19,6 +20,7 @@ def __init__(self, d=None):
self.month: Optional[int] = None
self.user_id: Optional[str] = None
self.day_no: Optional[int] = None
self.is_clear_schedule: Optional[bool] = None
init(self, d, self._types)

@staticmethod
Expand Down Expand Up @@ -50,5 +52,9 @@ def day_no(self, day_no: int) -> "UserDailyShiftBuilder":
self._user_daily_shift.day_no = day_no
return self

def is_clear_schedule(self, is_clear_schedule: bool) -> "UserDailyShiftBuilder":
self._user_daily_shift.is_clear_schedule = is_clear_schedule
return self

def build(self) -> "UserDailyShift":
return self._user_daily_shift
Loading

0 comments on commit 70ae412

Please sign in to comment.