Skip to content

Commit 6bacb1d

Browse files
authored
Add license headers and NOTICE.txt (#94)
1 parent e68245a commit 6bacb1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1571
-331
lines changed

LICENSE renamed to LICENSE.txt

File renamed without changes.

NOTICE.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
elasticsearch-rs (elasticsearch crate): Rust client for Elasticsearch
2+
Copyright 2012-2020 Elasticsearch B.V.

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[Docs]: https://docs.rs/elasticsearch/badge.svg
66
[docs.rs]: https://docs.rs/elasticsearch
77
[Apache-2 licensed]: https://img.shields.io/crates/l/elasticsearch.svg
8-
[license]: ./LICENSE
8+
[license]: ./LICENSE.txt
99

1010
Official Rust Client for [Elasticsearch](https://github.com/elastic/elasticsearch).
1111

@@ -246,4 +246,4 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
246246

247247
## License
248248

249-
This is free software, licensed under [The Apache License Version 2.0.](LICENSE).
249+
This is free software, licensed under [The Apache License Version 2.0.](LICENSE.txt).

api_generator/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "7.7.0-alpha.1"
44
description = "Generates source code for elasticsearch package, from the Elasticsearch REST API specs"
55
authors = ["Elastic and Contributors"]
66
edition = "2018"
7+
license = "Apache-2.0"
78
publish = false
89

910
[dependencies]

api_generator/src/api_generator/code_gen/mod.rs

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
pub mod namespace_clients;
220
pub mod params;
321
pub mod request;

api_generator/src/api_generator/code_gen/namespace_clients.rs

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
use crate::api_generator::*;
2-
320
use crate::api_generator::code_gen::request::request_builder::RequestBuilder;
421
use crate::api_generator::code_gen::*;
522
use inflector::Inflector;

api_generator/src/api_generator/code_gen/params.rs

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
use crate::api_generator::*;
2-
320
use inflector::Inflector;
421
use quote::Tokens;
522
use regex::Regex;
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
pub mod request_builder;

api_generator/src/api_generator/code_gen/request/request_builder.rs

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
use crate::api_generator::{
220
code_gen, code_gen::url::enum_builder::EnumBuilder, code_gen::*, ApiEndpoint, HttpMethod, Type,
321
TypeKind,

api_generator/src/api_generator/code_gen/root.rs

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
use crate::api_generator::*;
2-
320
use crate::api_generator::code_gen::request::request_builder::RequestBuilder;
421
use crate::api_generator::code_gen::*;
522
use inflector::Inflector;

api_generator/src/api_generator/code_gen/url/enum_builder.rs

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
/* Some types from or based on types from elastic: https://github.com/elastic-rs/elastic
220
*
321
* Licensed under Apache 2.0: https://github.com/elastic-rs/elastic/blob/51298dd64278f34d2db911bd1a35eb757c336198/LICENSE-APACHE
@@ -14,7 +32,6 @@
1432
* See the License for the specific language governing permissions and
1533
* limitations under the License.
1634
*/
17-
1835
use crate::api_generator::code_gen::url::url_builder::{IntoExpr, UrlBuilder};
1936
use crate::api_generator::{code_gen::*, ApiEndpoint, Path};
2037
use inflector::Inflector;
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
pub mod enum_builder;
220
pub mod url_builder;

api_generator/src/api_generator/code_gen/url/url_builder.rs

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
/* Some types from or based on types from elastic: https://github.com/elastic-rs/elastic
220
*
321
* Licensed under Apache 2.0: https://github.com/elastic-rs/elastic/blob/51298dd64278f34d2db911bd1a35eb757c336198/LICENSE-APACHE
@@ -14,7 +32,6 @@
1432
* See the License for the specific language governing permissions and
1533
* limitations under the License.
1634
*/
17-
1835
use crate::api_generator::code_gen::*;
1936
use crate::api_generator::{Path, Type, TypeKind};
2037
use quote::ToTokens;

api_generator/src/api_generator/mod.rs

+38-12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
use crate::api_generator::code_gen::url::url_builder::PathString;
220
use rustfmt_nightly::{Config, Edition, EmitMode, Input, Session};
321
use serde::{Deserialize, Deserializer};
@@ -441,21 +459,29 @@ fn write_file(input: String, dir: &PathBuf, file: &str) -> Result<(), failure::E
441459

442460
let mut file = File::create(&path)?;
443461
file.write_all(
444-
"// -----------------------------------------------
445-
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
446-
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
447-
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
448-
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
449-
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
450-
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
462+
"/*
463+
* Licensed to Elasticsearch B.V. under one or more contributor
464+
* license agreements. See the NOTICE file distributed with
465+
* this work for additional information regarding copyright
466+
* ownership. Elasticsearch B.V. licenses this file to you under
467+
* the Apache License, Version 2.0 (the \"License\"); you may
468+
* not use this file except in compliance with the License.
469+
* You may obtain a copy of the License at
470+
*
471+
* http://www.apache.org/licenses/LICENSE-2.0
472+
*
473+
* Unless required by applicable law or agreed to in writing,
474+
* software distributed under the License is distributed on an
475+
* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
476+
* KIND, either express or implied. See the License for the
477+
* specific language governing permissions and limitations
478+
* under the License.
479+
*/
451480
// -----------------------------------------------
452-
//
453-
// This file is generated,
454-
// Please do not edit it manually.
455-
// Run the following in the root of the repo:
481+
// This file is generated, Please do not edit it manually.
482+
// Run the following in the root of the repo to regenerate:
456483
//
457484
// cargo run -p api_generator
458-
//
459485
// -----------------------------------------------
460486
"
461487
.as_bytes(),

api_generator/src/error.rs

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
use std::fmt;
220

321
#[derive(Debug, Clone)]

api_generator/src/main.rs

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
extern crate dialoguer;
220

321
#[macro_use]

api_generator/src/rest_spec/mod.rs

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
extern crate reqwest;
220

321
mod parallel_downloading;

api_generator/src/rest_spec/parallel_downloading.rs

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
use super::RestApiSpec;
220

321
use indicatif::{MultiProgress, ProgressBar, ProgressDrawTarget, ProgressStyle};

0 commit comments

Comments
 (0)