Skip to content

Instantly share code, notes, and snippets.

View lmazuel's full-sized avatar

Laurent Mazuel lmazuel

View GitHub Profile
@lmazuel
lmazuel / cadl_fun.md
Last active December 14, 2022 03:12
CADL Model fun

Syntax 1

op (one: int32, two: int32): void;

Send JSON:

{"one": 12, "two": 47}
@lmazuel
lmazuel / update_labels.py
Created September 2, 2022 18:23
Push labels on Github
import sys
from github import Github, GithubException
REPOS = [
"Azure/azure-sdk-for-python",
"Azure/azure-sdk-for-net",
"Azure/azure-sdk-for-js",
"Azure/azure-sdk-for-java",
@lmazuel
lmazuel / dpg_process.md
Last active August 30, 2022 16:21
Process for issue declaration for CADL and DPG related issues

When creating an issue for DPG:

enum AppConfigurationEventTypes {
modified;
deleted;
}
model AppConfigurationBase<TResource> {
@doc("The key used to identify the key-value that was {name}.", TResource)
key?: string;
@doc("The label, if any, used to identify the key-value that was {name}.", TResource)
label?: string;
@lmazuel
lmazuel / swagger_hell.json
Last active February 7, 2022 23:29
Swagger and flattening
{
"swagger": "2.0",
"info": {
"title": "AutoRest Resource Flattening Test Service",
"description": "Resource Flattening for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": ["http"],
"produces": ["application/json"],
@lmazuel
lmazuel / test_llc.py
Created July 2, 2021 23:03
LLC test example
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
@lmazuel
lmazuel / result.txt
Created May 21, 2021 21:24
Required query params
Found 398 specs
Names {
isGroupbySite: 2,
nextPartitionKey: 2,
nextRowKey: 2,
query: 37,
errorBucket: 1,
farmerId: 8,
boundaryId: 3,
otherFarmerId: 1,
@lmazuel
lmazuel / llv_view.py
Last active May 12, 2021 17:33
LLC view brainstorm
# from m4
intpu = "code-model-+no-tags.yuaml"
model = yaml.parse(input)
main_view : LLCClientView = process_model(model)
# from Swagger
@lmazuel
lmazuel / all_scenarios.py
Last active February 9, 2021 23:02
LowLevel brainstorm
import os
import json
#
# Low-level client: lowest possible call
#
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.core.credentials import AzureKeyCredential
from azure.ai.textanalytics import TextAnalyticsClient
@lmazuel
lmazuel / paging.py
Created October 29, 2020 21:13
Paging brainstorm
# I want to use headers and not JSON to get next Link, and the Swagger didn't help
class MyPagingMethod(PagingProtocol):
def extract_continuation_token(self, pipeline_response, deserialized):
return pipeline_response.http_response.headers["x-ms-continuation-token"]
client.list(paging_method=MyPagingMethod())
# I want to use headers and not JSON to get next Link